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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Lookup of second table

Status
Not open for further replies.

briant

Technical User
Apr 15, 2000
4
AU
I have a main form &quot;Sold&quot;.&nbsp;&nbsp;From this I have a pop up sub form &quot;Commissions&quot; which has option buttons.<br><br>At present I have the calculations in the &quot;Commissions&quot; form which are performed depending on which button is clicked and the answer is placed into the &quot;commissions&quot; field <br>in the sold table.<br><br>I have now created a new table called &quot;Commissions&quot; so the variables can be placed in this table for easy update instead of having to do it in design forms.<br><br>In the &quot;Commissions&quot; table there are only three records, Comm1, Comm2, Comm3 which each has eleven fields and a numeric value in each.<br><br>I need to lookup say Comm1 in the Commissions<br>table and bring back the field values for that record.&nbsp;&nbsp;I am also not sure if I need the Commissions table linked.<br><br>Thanks in advance.<br><br>Brian<br><br><br><br><br><br><br>
 
Try in you sold form:<br><br>strCriteria = &quot;[CommID]=&quot; & Forms!frmCommPopup.SelectedCommID<br>Sold!Commission = DLookup([CommID], [tblCommissions], strCriteria)<br><br>(SelectedCommID = the id selected on the popup form)<br><br>Hopefully that should work, unless I got the DLookup structure wrong.
 
I'm having a problem with DLookup also. I have a main form (FormI) and a linked form (FormII). I have a CustomerID field on FormI. This field is in the Customers table. I want to put a field on FormII that looks up this value. However, I want the CustomerID on FormII to match the CustomerID on Form I (A way of linking these forms). I've tried doing this using the Lookup tab within the table itself and it's not working, so I'm onto this path. Here's the expression I put into the control:

=DLookUp(&quot;[CustomerID]&quot;,&quot;Customers Table&quot;)

I've tried adding some criteria to this but it's not working. Does anybody know how I can pull this value into FormII, and have FormII match FormI, as far as this CustomerID field???????

Thanks!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top