Need help developing coding

G

Guest

The coding below has worked fine for now - but I experience problems if my
Customers field has duplicate data.

I wish to add a second field of data to use in the openform section but it
is numeric.

For instance open form based on selected Customer and AccountNo.


Private Sub Customer_DblClick(Cancel As Integer)
DoCmd.OpenForm "Customers", , , "[Customer] = '" & [Customer] & "'"
Dim stDocName As String

stDocName = "CloseSearchResult"
DoCmd.RunMacro stDocName
End Sub

My other thought is to run something similiar to the above where it would
still use the customer field to double_click on but it use the CustID (Unique
field) as a reference point - but I am unsure how to write that out.
Many thanks
 
S

Scott McDaniel

The coding below has worked fine for now - but I experience problems if my
Customers field has duplicate data.

I wish to add a second field of data to use in the openform section but it
is numeric.

For instance open form based on selected Customer and AccountNo.

If your CustID field available on the form where you're running this code? IF so, just do this:

Private Sub Customer_DblClick(Cancel As Integer)
DoCmd.OpenForm "Customers", , , "[CustID]=" & Me.CustID

Assuming CustID is a number, otherwise put the single quotes back in.

Scott McDaniel
scott@takemeout_infotrakker.com
www.infotrakker.com
 

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