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

ON Doubleclick in Form for autonumber field 1

Status
Not open for further replies.

knuckelhead

Technical User
Aug 8, 2002
228
US
Below is vba that a consultant wrote for me a few years ago for a text field doubleclick method. i now have a need to doubleclick that uses an autonumber field named JunctionID.

Can you advise on proper statement for this autonumber deal?
Below is my current working method when the field FormulaID is a text field (willing to improve, if you see something about this text field method.)


Private Sub FormulaID_DblClick(Cancel As Integer)
'================================================
'FormulaID is a Text field.

Dim strCrit As String
If Trim$(Me!FormulaID.Value & "") <> "" Then
strCrit = "FormulaID = '" & Me.FormulaID & "'"
End If
DoCmd.OpenForm "frmFormulaBuild", acNormal, , strCrit, , acNormal

End Sub

====================================================


I need a similar form doubleclick when my field JunctionID is an Autonumber field. i imagine that the autonumber means i need to change some quote marks?

thanks
knucklehead
 
Why not use the command button wizard do the work for you?

Private Sub JunctionID_DblClick(Cancel As Integer)
Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmFormulaBuild"

stLinkCriteria = "[JunctionID]=" & Me![JunctionID]
DoCmd.OpenForm stDocName, , , stLinkCriteria

End Sub
 
yes. that works fine. Sorry for not telling you faster. I will donate to the club.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top