Need help developing coding

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
Back
Top