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

Call code from Module

Status
Not open for further replies.

stevo1961

Technical User
Nov 12, 2014
18
IE
Hi,

I have this code on a cmdbutton "cmdBarcode" called from my form "Jobs". I would like to call this from a Module instead of the form. I am having problem calling this from ta Module. I think it's the Me.Dirty that might be the problem.

Private Sub cmdBarcode_Click()
On Error GoTo Err_cmdBarcode_Click
Dim intResult As Integer
Dim strTitle As String
Dim strMsg As String
Dim intMsgDialog As Integer
Dim intResponse As Integer

strTitle = "Barcode Printing?"
intMsgDialog = vbOKOnly + vbInformation

If IsNull(Forms!Jobs![Delivery Dockets].Form!PltType) Then
strMsg = "Please make sure you have entered a Pallet type"
intResult = MsgBox(strMsg, intMsgDialog, strTitle)
ElseIf IsNull(Forms!Jobs![Delivery Dockets].Form!Quantity) Then
strMsg = "Please make sure you have entered a Quantity"
intResult = MsgBox(strMsg, intMsgDialog, strTitle)
Else

If Me.Dirty = True Then Me.Dirty = False
Forms![Jobs]![Delivery Dockets].Requery

Call openForm("frmBarcode")

End If

Exit_cmdBarcode_Click:
Exit Sub

Err_cmdcmdBarcode_Click:
MsgBox Err.Description
Resume Exit_cmdBarcode_Click
End Sub

Any assistance would be helpful...

Thanks
 
Sorted

If Forms![Jobs].Dirty = True Then Forms![Jobs].Dirty = False
Forms![Jobs]![Delivery Dockets].Requery
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top