Advanced ComboBox

M

MiHutch

Here is my setup; I have a form which is used for hardware inventory. In the
form I have a combo box which refers to a piece of hardware. The item values
in the combo box are desktop, laptop, cell phone and external hard drive.
Currently when I select an item then double click on the combo box it opens a
second form where I am adding additional information about the item. This
second combo box is not item specific, but a very general hardware form.

Is there a way to have several different forms based on the item in the combo
box? I would like to select laptop in the combo box, then when I double click
on the combo box the computer data entry form will open. If I select cell
phone I would like a cell phone data entry form will open.

Is this possible? I could recreate the forms to work, but this would work
great for me.

Thanks for any suggestions.
MiHutch
 
G

Gina Whipp

MiHutch,

Yes, this is possible but wondering why you would want to do it this way.
That means IF you add anything to the combo box you need to create a new
form... to much work.

Inventory is inventory, so what you need is one table and one pop-up form
that the caption will change on based on the selection in the combo box.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 
M

MiHutch via AccessMonster.com

Gina, thanks for the response.

I like the single table setup, but is it a macro expression or will I have to
do some programming to get this function to work?

Thanks,
MiHutch
 
G

Gina Whipp

MiHutch,

It will require a little programming BUT anyone here can help with that with
ease so don't panic. I imagine it could be done with a macro but I haven't
used them in years but I could probably figure that out.

An example of what would be need to open another form from a combo box in
the main form...

DoCmd.OpenForm "frmAssociatedCards", , , "[ppPropertyID]=" &
Me![cboAssociatedPropertyID]

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 
M

MiHutch via AccessMonster.com

Ok, I am very weak in this area, but have been looking all over the internet
trying to learn it fast. I am looking at the code and don't see where it will
look up the inventory then open the correct form.

Here is my setup; I have a table called "Inventory" which contains records
for Inventory_ID which is an AutoNumber, Type (Combo Box, value list which I
will be changing to a table), Serial_# and CellPhone_#. I have two forms
designed to open based on what item is selected from the Type combo box. The
first form is Computer Inventory Form, this will show data for computers, i.e.
hard drive size, hard drive make. The second form is called CellPhone Form
which will show cell phone only data, i.e. phone number.

Right now the options are Laptop, Desktop, Cell Phone. If I double click on
the type box now the Computer Inventory Form opens correctly to the correct
record. I used a Marco expression to build this, maybe not the cleanest way
but it works.

What do I need to do to get it to open to a form based on the combo box type
selected? I am looking at the command below and missing where this takes
place.

I have tried to look around to find out how to make this work with no luck.
Where can I find out how to build the expression below? Is it a SQL
expression or a VB expression? I am trying to break it down section by
section with no luck.

Thanks for any help you can give.

MiHutch

Gina Whipp wrote:
..
DoCmd.OpenForm "frmAssociatedCards", , , "[ppPropertyID]=" &
Me![cboAssociatedPropertyID]
 
G

Gina Whipp

MiHutch,

Okay... I see why you are getting confused. The example I provided will
work if you use one form as I suggested. To get the form to open with the
way you want to do it would be differently... A Select Case would probably
be the best way. Without reading and trying to figure out what's what...

Select Case NameOfYourComboBox
Case "CellPhone"
DoCmd.OpenForm "YourFormNameHere"
Case
Keep going till all done
End Select

Place the above on double-click of your combo box. The above cannot be done
in a macro.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

MiHutch via AccessMonster.com said:
Ok, I am very weak in this area, but have been looking all over the
internet
trying to learn it fast. I am looking at the code and don't see where it
will
look up the inventory then open the correct form.

Here is my setup; I have a table called "Inventory" which contains records
for Inventory_ID which is an AutoNumber, Type (Combo Box, value list which
I
will be changing to a table), Serial_# and CellPhone_#. I have two forms
designed to open based on what item is selected from the Type combo box.
The
first form is Computer Inventory Form, this will show data for computers,
i.e.
hard drive size, hard drive make. The second form is called CellPhone Form
which will show cell phone only data, i.e. phone number.

Right now the options are Laptop, Desktop, Cell Phone. If I double click
on
the type box now the Computer Inventory Form opens correctly to the
correct
record. I used a Marco expression to build this, maybe not the cleanest
way
but it works.

What do I need to do to get it to open to a form based on the combo box
type
selected? I am looking at the command below and missing where this takes
place.

I have tried to look around to find out how to make this work with no
luck.
Where can I find out how to build the expression below? Is it a SQL
expression or a VB expression? I am trying to break it down section by
section with no luck.

Thanks for any help you can give.

MiHutch

Gina Whipp wrote:
.
DoCmd.OpenForm "frmAssociatedCards", , , "[ppPropertyID]=" &
Me![cboAssociatedPropertyID]
 
M

MiHutch via AccessMonster.com

That worked pretty well and is very clean. Is there a way to have it open to
a specific record I am double clicking? I had it setup so when double clicked
on the Type for let’s say record 10 it would open up the computer form for
record 10.

When I double click now it takes me the correct form based on what I set, but
always to record 1.

I really appreciate the help, it is looking good. I didn't think I was going
to be able to get this to work.

Thanks,
MiHutch
 
M

MiHutch via AccessMonster.com

The forms that I want it to open are separate, but the table that the data is
stored in from both forms are the same.

MiHutch

Gina said:
MiHutch,

Glad that part worked for you... Yes but do you have a seperate form or are
you trying to have the same form open to a specific record?
That worked pretty well and is very clean. Is there a way to have it open
to
[quoted text clipped - 20 lines]
 
G

Gina Whipp

MiHutch,

Okay then I need the name of the forms. ANother thought, you might get a
"Can't save record..." message because of write conflict. You will need to
add a Save command to the form that gets edited on to the Unload.

Here is an example (watch out for word wrap)... DoCmd.OpenForm
"NameOfFormYouWantToOpen", , , "[PKOnTheFormYouAreOpening]=" &
Me![ComboBoxOnFormYouAreOpeningFrom]

However, if this is a seperate function then you might want to attach the
above to a command button.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

MiHutch via AccessMonster.com said:
The forms that I want it to open are separate, but the table that the data
is
stored in from both forms are the same.

MiHutch

Gina said:
MiHutch,

Glad that part worked for you... Yes but do you have a seperate form or
are
you trying to have the same form open to a specific record?
That worked pretty well and is very clean. Is there a way to have it
open
to
[quoted text clipped - 20 lines]
Keep going till all done
End Select
 
M

MiHutch via AccessMonster.com

Thank you very much, it works great. I almost had it, but messed up a couple
of line until your post. I think I need to learn VB, it looks much cleaner
and I could understand it better then the macro.

Again thanks, you are great!!!

MiHutch

Gina said:
MiHutch,

Okay then I need the name of the forms. ANother thought, you might get a
"Can't save record..." message because of write conflict. You will need to
add a Save command to the form that gets edited on to the Unload.

Here is an example (watch out for word wrap)... DoCmd.OpenForm
"NameOfFormYouWantToOpen", , , "[PKOnTheFormYouAreOpening]=" &
Me![ComboBoxOnFormYouAreOpeningFrom]

However, if this is a seperate function then you might want to attach the
above to a command button.
The forms that I want it to open are separate, but the table that the data
is
[quoted text clipped - 14 lines]
 
G

Gina Whipp

MiHutch,

You are MOST welcome.... and I am glad we have got you past that initial
*fear* of VBA! There are LOTS of examples out there. Here are a few to get
you started...

http://www.mvps.org/access/

http://allenbrowne.com/tips.html

http://www.rogersaccesslibrary.com/OtherLibraries.asp

http://www.accessmvp.com/

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

MiHutch via AccessMonster.com said:
Thank you very much, it works great. I almost had it, but messed up a
couple
of line until your post. I think I need to learn VB, it looks much cleaner
and I could understand it better then the macro.

Again thanks, you are great!!!

MiHutch

Gina said:
MiHutch,

Okay then I need the name of the forms. ANother thought, you might get a
"Can't save record..." message because of write conflict. You will need
to
add a Save command to the form that gets edited on to the Unload.

Here is an example (watch out for word wrap)... DoCmd.OpenForm
"NameOfFormYouWantToOpen", , , "[PKOnTheFormYouAreOpening]=" &
Me![ComboBoxOnFormYouAreOpeningFrom]

However, if this is a seperate function then you might want to attach the
above to a command button.
The forms that I want it to open are separate, but the table that the
data
is
[quoted text clipped - 14 lines]
Keep going till all done
End Select
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top