extract value from cobmo boxes

S

Shetty

Dear Friends

I have combo box in my form which contaims 3 columns

I want to full the value of column 2 of above to another combo box on got
focus event. ie on focus 2nd combo box to be filled with text value of of
2nd column of the 1st combo box. This must happen only if the second combo
is null

Please guide me how to write code for the same

Thanks & reagrds


Ramesh shetty
 
J

John W. Vinson

Dear Friends

I have combo box in my form which contaims 3 columns

I want to full the value of column 2 of above to another combo box on got
focus event. ie on focus 2nd combo box to be filled with text value of of
2nd column of the 1st combo box. This must happen only if the second combo
is null

Please guide me how to write code for the same

Thanks & reagrds


Ramesh shetty

This seems a very strange thing to do. A Combo Box is intended to *select*
data from a lookup table, its rowsource. Pushing a text value from one combo
into another combo would be peculiar.

What are the purposes of these two combo boxes? What are their respective Row
Sources and Control Sources? Why do you feel that you need to do this?

John W. Vinson [MVP]
 
S

Shetty

Dear Sir,

My first combo contains 2 comulms
1st column custoemr ID
2nd column customer name & address

My second combo contains again 3 colums
1 st column machine ID
2nd column customer name & address
3rd column machine serial number

At present I am application for amc maitenance software. A customer may have
more that machines, so machine table and customer table are differenet.
Further a AMC collection from a single customer may pertaining to verious
machines related to same customer which are located in its various branches.
So After collection I want to allocate each payment for respective machines.

By default combo1 column2 value will be equal to
combo2 column 2 (Eventhough customer ID(Combo1) & machine ID's (combo2)will
be defferent.

So on got focus of combo2 I want to select customer name & address which is
equal to combo1 column2 text

Or else the user has to type and select machine address as most of the cases
customer address = machine location address

Please advise on the above.

Or let me know if you have any alternative method for handling above issue.

I am basic programmer without much exposure to MS Access.

Both the tanles customer and machine are having one to many relation ships
with customer ID primery key

Thanks

Ramesh Shetty
 
J

John W. Vinson

Dear Sir,

My first combo contains 2 comulms
1st column custoemr ID
2nd column customer name & address

My second combo contains again 3 colums
1 st column machine ID
2nd column customer name & address
3rd column machine serial number

I really suspect this is a mistake. A machine does not have a customer name!
Shouldn't the machine table have a field for the customer ID (as a link to the
customer table?) What are the structures of the underlying tables - what
other fields do they have?

At present I am application for amc maitenance software. A customer may have
more that machines, so machine table and customer table are differenet.
Further a AMC collection from a single customer may pertaining to verious

What's a AMC collection? Bear in mind that not every TLA is understandable to
people outside the area of specialty.
machines related to same customer which are located in its various branches.
So After collection I want to allocate each payment for respective machines.

By default combo1 column2 value will be equal to
combo2 column 2 (Eventhough customer ID(Combo1) & machine ID's (combo2)will
be defferent.

I'm sorry, that does not make sense and does not follow. Why should the
Machine combo box have the customer name or address AT ALL!?
So on got focus of combo2 I want to select customer name & address which is
equal to combo1 column2 text

Do you want to filter the Machine combo box to display only machines at the
selected customer's address? That's easy, though it will be done differently
than you seem to be visualizing.
Or else the user has to type and select machine address as most of the cases
customer address = machine location address

What is the PURPOSE of the second combo? To select a *machine* (perhaps one of
several at an address) or to select an address?
Please advise on the above.


Both the tanles customer and machine are having one to many relation ships
with customer ID primery key

Relationships to... what? If one customer has multiple machines then the
CustomerID cannot be the primary key of the machine table; that would require
that each customer has one and only one machine, since the PK is by definition
unique within the table.

John W. Vinson [MVP]
 

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