On the form where the StickerLookup_Btn is located, again add a textbox for the user to enter a Sticker number. A better option actually may be to use a combobox, to allow the user to select the sticker number (again the wizard can walk you through the creation of the combobox - have it lookup the stickerid in your table where the stickers are stored). You can then make a minor change in the code below. I'm assuming that sticker number is actually a number, and not text, I also named the combobox cboChooseSticker
**The code for the Sticker Lookup command button is as follows:
Private Sub StickerLookup_Btn_Click()
On Error GoTo Err_StickerLookup_Btn_Click
Dim stDocName As String
*** Dim stLinkCriteria As String*** change to
Dim lngLinkCriteria As Long
stDocName = "Sticker No Lookup Form"
lngLinkCriteria = Me!cboChooseSticker
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_StickerLookup_Btn_Click:
Exit Sub
Err_StickerLookup_Btn_Click:
MsgBox Err.Description
Resume Exit_StickerLookup_Btn_Click
End Sub
**The License Lookup Command button is entirely different:
In the On Click property the License Lookup Btn brings up a macro to open the
form.
Is that all the macro does? If so, you can use the code I posted previously, which you said worked for you
By the way, the code above for the StickerLookup could also have been done in a macro. You can use macros, however you have more flexibility using code, and you can handle errors gracefully.