Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Module to control a field

Status
Not open for further replies.

jdwm2310

Technical User
Jul 26, 2001
396
US
Hi,

I have a form which has a series of fields. There are two fields in particular that i want to focus on. The field names are Owner Name and Locator.
Owner Name is a combo box and Locator is a list box.
I want Owner Name to control the Locator. So for example:
Owner Name = John Jones then Locator= New York
Owner Name = Susan Noll then Locator= California

So everytime John Jones is selected the Locator will be defaulted to New York

Any suggestions as how to approach this...thanks
 
Hi,

If you have the key to the LOCATOR in your OWNER NAME combobox, you should in the CLICK event of the combo box :
me.listbox = me.combobox.column(TheColumnWhereTheKeyIs)

that should do the trick!

hope it helps Salvatore Grassagliata
GrassagliataS@hotmail.com
 
this is what i have:

me.File Type = me.comb49.column(2)

I am getting a syntax error
 
I still get a compile & syntax error

me.File Type = me.combo49.column(2)
 
hi,

you should try

me("ListBoxName") = me.combobox.column(2)

this should do.
Salvatore Grassagliata
 
it doesn't work...let's forget about the column...i deleted the 2nd column, i want the field owner to give the field location and cabinet a default value, however there are three default values

for example
Owner: Jane Location: 10 Cabinet: Finance
Owner: Tom Location: 23 Cabinet: HR
Owner: Steve Location: 3 Cabinet: IT

These are the only owners i will be using in this database and their location and cabinet will not change.
So owner is a combobox if I select Jane Location and Cabinet will be automatically be filled in with 10 and Finance....Please help...if i am not making sense please let me know..thanks
 
Hi,

If you are sure that everything will be solid and never move
I suggest in the CLICK event of the combobox

SELECT CASE me.combobox
Case "Jane"
me("txtLocation") = 10
me("txtCabinet") = "FINANCE"

Case "Tom"
...
...
End Select

Hope this will do.

Salvatore Grassagliata
 
RickBerem,

You are the best...it worked beautifully...thanks so much!!!!!!!!!!!!!!!!!!!!!!! [wiggle]

 
Not that it matters now, but I believe that the error your were receiving was due to the column(index) starting with the first column as 0 so column(1) actaully refers to your second column.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top