combo box (based on linked table) to access table

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I'm new to access but have a programming background. My question is what VB
code is needed when I use a value from a linked table (CustID) as the value
in the Combo Box to access another table (Call Tracking) which may have
multiple entries for the CustID. I want to be able to add and modify entries
for the Call tracking table.

I have created another form with 2 list boxes and a combo box. This form
works and allows users to click ont the combo box, select a customer, shows
orders for the customer, and then you can click on the order and see the line
items for each order. I used an example from the book "Special Edition using
Microsoft Access 2002" as the basis and was able to modify the VB code to
make it work for my needs. I was able to tie the SQL code to each list boxes
rowsource property and do a requery. It works well.

However, in the form I'm developing where you can access each individual
field, I can't figure out the VB code I need behind the scenes to access the
records in the call tracking table that match the CustID I select in the
combo box.

Thanks in advance for any help you can give me.
 
Bob said:
Hi,

I'm new to access but have a programming background. My question is what VB
code is needed when I use a value from a linked table (CustID) as the value
in the Combo Box to access another table (Call Tracking) which may have
multiple entries for the CustID. I want to be able to add and modify entries
for the Call tracking table.

I have created another form with 2 list boxes and a combo box. This form
works and allows users to click ont the combo box, select a customer, shows
orders for the customer, and then you can click on the order and see the line
items for each order. I used an example from the book "Special Edition using
Microsoft Access 2002" as the basis and was able to modify the VB code to
make it work for my needs. I was able to tie the SQL code to each list boxes
rowsource property and do a requery. It works well.

However, in the form I'm developing where you can access each individual
field, I can't figure out the VB code I need behind the scenes to access the
records in the call tracking table that match the CustID I select in the
combo box.

Thanks in advance for any help you can give me.

Bob,

If I understand right, you will select a customer in the combo box, then
click somthing and open another form that displays call details (call
tracking)?

In design view of the query for the (new) call tracking form, for the CustID
FK criteria row, put:

[Forms]![FormName].[ControlName]

where [FormName] is the name of the form where the combo box is and
[ControlName] is the name of the "CustID" combo box.

If you looked at the SQL of the form record source, it would look something
like:

Select CallTrackingId, CustID_FK, CallTime From tblCallTracking Where
CustID_FK = [Forms]![FormName].[ControlName] Order by CallTime Desc;


HTH
 

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

Back
Top