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

How to pass a variable?

Status
Not open for further replies.

access345

Programmer
Nov 23, 2005
78
US
I have a procedure that I was hoping to pass a variable (The enter the serial number variable). What I need is to enter the serial number once and have all the procedures execute.


Private Sub btnrwk1dspTT_Click()
On Error GoTo Err_btnrwk1dspTT_Click

Dim stDocName As String
' Define Time Out
'UPDATE TblReworkTime SET TblReworkTime.Rework1TO = Now()
'WHERE (((TblReworkTime.Rework1TO) Is Null) AND ((TblReworkTime.SerialNumber)=[Enter Serial Number]));

'Define Total Time
'UPDATE TblReworkTime SET TblReworkTime.Rework1TT = [Rework1TO]-[Rework1TI]
'WHERE (((TblReworkTime.SerialNumber)=[Enter Serial Number]));
' Display Total Time
'SELECT TblReworkTime.SerialNumber, TblReworkTime.Rework1TT AS [Total Time]
'FROM TblReworkTime
'WHERE (((TblReworkTime.SerialNumber)=[Enter Serial Number]));


stDocName = "qryselectRwk1TT"
DoCmd.OpenQuery stDocName, acNormal, acEdit

Exit_btnrwk1dspTT_Click:
Exit Sub

Err_btnrwk1dspTT_Click:
MsgBox Err.Description
Resume Exit_btnrwk1dspTT_Click

End Sub
 
access345,
declare the variable as public at the module level?
regards,
longhair
 
Or use a TextBox

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
using a text box is defen. easier i agree with ph
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top