Thanks for the reply but I ended up curing the problem by inserting a space between the , and the Max. Compare:
SELECT A.itemfield, Max(A.nowfield) As maxBut1Date FROM theTable A INNER JOIN
(SELECT itemfield, Max(nowfield) As maxDate FROM theTable GROUP BY itemfield) B
ON A.itemfield =...
It works fine until I actually try to use it in the application. then I get an error about somethin like > and < are not supported and the query changes to:
SELECT A.serial, Max(A.actionDate) AS maxBut1Date
FROM master AS A INNER JOIN [SELECT serial,Max(actionDate) As maxDate FROM master GROUP...
Following on from my previous posts is it possible to get my own text box to pop up for an input mask violation and to get the cursor back at the beginning of the input field after ok is pressed.
Sorted that one.
I put the following in the nest field along after 'job'
Private Sub serial_GotFocus()
If IsNull(Me.job) Then
MsgBox "You Must Input a Job Number!", vbInformation, "HEY FOOL!"
Me.job.SetFocus
Cancel = True
Else:
End If
End Sub
1 last thing.
Ive tried this on a text box on a form displayed as a data sheet.
Although the message pops up etc it doesnt set the focus back to the text box but moves on to the next field as usual
If IsNull(Me.job) Then
MsgBox "You Must Input a Job Number!", vbInformation, "HEY FOOL!"...
Here's the final code if it helps someone else:
Private Sub Command2_Click()
On Error GoTo Err_Command2_Click
If IsNull(Me.engineer) Then
MsgBox "You Must Choose an Engineer", vbInformation, "HEY FOOL!"
Me.engineer.SetFocus
Cancel = True
Else:
stDocName = "issuestock"...
I'm sure you wrote that before I posted my error!!
You and Leslie make a superb double act.
Thanks, it worked. To celebrate I'm not going to stay up 'till 3am working on the thing tonight. It's only 10.30pm and I might even talk to the wife for a while!
Thanks Rick.
Here's the final code I used:
Private Sub Serial_NotInList(NewData As String, Response As Integer)
Me.Serial.SelStart = 0
Me.Serial.SelLength = Len(Nz(Me.Serial, ""))
MsgBox "This box is not showing in the warehouse!"
Response = acDataErrContinue
End Sub
I wish...
Ok guys, you've patiently got me this far. txaccess, I have trouble understanding the process of changing vbOKcancel to vbInformation. I understand that I need to set focus back to the 'engineer' combo box but having tried a few variations I have to ask your help please. I have now got on the...
I was just about to say it didn't work when I realised that as I am still in the testing stage I hadn't enter a 'required' input mask (I haven't got the barcode scanner with me and couldnt be bothered to type in 17 digit made up numbers!!)
Can I set my own text box error message instead of the...
Thanks txacces. Got the error box up on null entry but when I press ok it still goes to the next form, 'issuestock'. How do I stop it passing the to this?
Transition is triggered by an enter buton with the following onclick:
stDocName = "issuestock"
DoCmd.OpenForm stDocName
Thanks Rick, I got to this part but I'm not sure where to put the response bit:
Private Sub Serial_NotInList(NewData As String, Response As Integer)
Me.Serial.SelStart = 0
Me.Serial.SelLength = Len(Me.Serial)
End Sub
Using just the above gives the error 'Run time error '94'
invalid use...
Another question:
I have a combo box that populates with serial numbers based on a query. It goes through a Me.refresh before the next one can be input. When a duplicate entry is attempted it triggers the notinlist error. You click ok but then you have to delete the shown data before trying...
I have a combo box that has two choices, good or faulty which then appear in a text field on the next form.
How do I prevent a user pressing the enter button without making a choice from the combo?
Damn, hit submit instead of preview.
I have a data entry form that updates the above table if an item with a particular serial number is, say, returned. The serial number entry combobox data is limited by query to only items whose last location is 'warehouse'. (by maxActiondate) Another combo...
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.