Now you have me intrigued.
Your part on finding the correct record works. But I can't get the time function to work.
Here is what I have:
Private Sub btnFindRecord_Click()
On Error GoTo Err_btnFindRecord_Click
Dim stDocName As String
Dim intSNo
Dim LaborCount As Double...
I have created a button that I want to fine a specific record based on its serial number. After the record is found I want a query to be executed based on the serial number that would record what time the button was pushed.
What is currently happening is when I click on the button. I get a...
Is there a way of tracking a person by their login? My forms currently have a list box with the asking the person to click on themselves. If there was a way of transferring who they are currently logged in as it would make my life easier.
I added your code:
Public Sub DefectCnt1()
On Error GoTo ERR_DefectCnt_1
Dim SerialNumber As Long
Dim Counter As Double
Dim SQL As String
Dim ReworkCount As Double
Dim strQueryName As String
SerialNumber = 4569
If Counter = 0 Then Counter = 1
Counter = DLookup(([ReworkCount] + (1))...
I changed some things and now he code will execute. But the counter is not working.
Public Sub DefectCnt1()
On Error GoTo ERR_DefectCnt_1
Dim SerialNumber As Long
Dim Counter As Double
Dim ReworkCount As Double
Dim strQueryName As String
SerialNumber = 4569
If Counter = 0 Then Counter = 1...
Public Sub DefectCnt1()
On Error GoTo ERR_DefectCnt_1
Dim SerialNumber As Long
Dim Counter As Double
Dim ReworkCount As Double
Dim strQueryName As String
SerialNumber = 4869
Counter = DLookup("ReworkCount", "TblPAQ3280Process", "SerialNumber =" & SerialNumber) + 1
strQueryName =...
Public Sub DefectCnt1()
On Error GoTo ERR_DefectCnt_1
Dim SerialNumber As Long
Dim Counter As Double
Dim ReworkCount As Double
SerialNumber = 4869
Counter = DLookup("ReworkCount", "TblPAQ3280Process", "SerialNumber =" & SerialNumber) + 1
strQueryName = "qryupdateRwk" & Counter...
This is the whole module:
Public Sub DefectCnt1()
On Error GoTo ERR_DefectCnt_1
Dim TotalTime As Long
Dim SerialNumber As Long
Dim SQL As String
Dim DefectCounter As Double
Dim Counter As Double
Counter = 1
For DefectCounter = 1 To Counter
'Update ReworkLabor1 Field with total time...
The query did execute thanks PHV. But my next question is if I have count =1 than how is the counter going to work? Isn't the counter always going to be at 1?
I Removed the Set command
When I step through the code
If DefectCounter = 1 Then
DoCmd.OpenQuery (qryupdateRwk1), acViewNormal, acEdit
I get to the DefectCounter =1
But when I look at qryupdateRwk1 it says its empty
Different approach
Public Sub DefectCnt1()
On Error GoTo ERR_DefectCnt_1
Dim TotalTime As Long
Dim SerialNumber As Long
Dim SQL As String
Dim DefectCounter As Double
Dim Counter As Double
Set Counter = 1
For DefectCounter = 1 To Counter
'Update ReworkLabor1 Field with total time...
Dim TotalTime As Long
Dim SerialNumber As Long
Dim SQL As String
Dim DefectCounter As Double
Dim Count As Double
Set Count = 1
For DefectCounter = 1 To Count
'Update ReworkLabor1 Field with total time
SQL = "UPDATE TblPAQ3280Process " & _
"SET ReworkLabor" &...
I added the dbFailOnError command and the counter still is not working. When I step through the program It goes to For Defectcounter = 1 To B than to exit sub. Maybe I need to take the query language out and do a DoCMd openQuery()?
I adapted your Code
Public Sub DefectCnt()
On Error GoTo ERR_DefectCnt_1
Dim TotalTime As Long
Dim SerialNumber As Long
Dim SQL As String
Dim Defectcounter As Double
For Defectcounter = 1 To B
'Update ReworkLabor1 Field with total time
SQL = "UPDATE TblPAQ3280Process " & _...
I need a For Next loop to count the amount of times a instance occurs. I will warn helpers this is the first time I have tried to create one. What I am trying to accomplish is to have a counter keep track of defects. When I have a defect a person will click on a button that will call this loop...
Public Sub LookupValue()
On Error GoTo ERR_txtRefDesig5
'Dim FormName As String
Dim myActiveForm As Form
Dim TableName As String
Dim FormEntryTextBox As String
Dim DisplayTextBox1 As String
Dim EntryTextBoxFromTable1 As String
Dim LookupValueFromTable1 As String
TableName...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.