Displaying a simple message box

  • Thread starter EMILYTAN via AccessMonster.com
  • Start date
E

EMILYTAN via AccessMonster.com

I want to display a message box when the subform loads and list all the part
numbers that the type is wrong.
This code, I put it in the subform however this can only display a part
number
Any idea?

Code :-
mySQL = "SELECT WIPRawDetails.PartNumber, W_Type FROM WIPRawDetails WHERE
WIPRawDetails.JobNumber= '" & Me.txtJobNumber & "'"
myrecset.Open mySQL

Do Until myrecset.EOF
strType = Nz(DLookup("WIPType", "Inventory", "PartNumber='" & txtPartNumber &
"'"))

If myrecset!W_Type <> strType Then
Debug.Print myrecset!PartNumber
PartNumber = PartNumber & "," & myrecset!PartNumber
EndIf
myrecset.MoveNext
Loop
myrecset.Close
If PartNumber <> "" Then
MsgBox "This is the list of PartNumber which the item is not match!" &
PartNumber
End If
 
G

Guest

Emily;

When you defined the PartNumber field in your table, did you allow
for 0 Records?

If you did not do this the Line If PartNumber <> "" Then will
not execute properly.

Remember if the field is Null it will just ignore the script.

Please check this first.

Good Luck

Len
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top