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

Programming an Edit/Delete Button on Switchboard

Status
Not open for further replies.

murk

Technical User
Nov 26, 2002
16
0
0
US
When programming such a button in it's properties, event, on click, what is the exact formula to do this. I need to see all spaces, parenthesis etc. The following was one I was given but the 2nd last line didn't work. Help.

Private Sub OpenFormButton_Click()

Dim stDocName As String
Dim stLinkCriteria As String
Dim stPolicy as Variant

stDocName="frmNameofForm"
stPolicy=InputBox "Enter Policy Number?"
stLinkCriteria="stPolicy="&Me![PolicyNumber]
DoCmd.OpenForm stDocName,,,stLinkCriteria

End Sub

Thanks a bunch!!

Jennifer
 
[worm] Should probably be this:
Code:
stLinkCriteria= "[PolicyNumber]=" & stPolicy

If the [PolicyNumber] is actually a string then add single quotes:
Code:
stLinkCriteria= "[PolicyNumber]= ' " & stPolicy & " ' "
VBSlammer
redinvader3walking.gif

Unemployed in Houston, Texas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top