What does the blue text stand for?

hunterfan48

Registered User.
Local time
Today, 10:37
Joined
Aug 17, 2008
Messages
436
When trying to read code, I notice the different colors of the text. I've been told that green text are comments, but I'm not sure what blue text is?

Could someone please simply clue me in?

Thanks!
 
Access/VBA keywords that are not functions, properties or methods.
 
Ok... thank you sir!
 
You're welcome! There's more to it but that was just the short version.

Happy developing.
 
Thanks...I could use your assistance again if you don't mind.

Why isn't my code (the 1st one) not working and the second code for the sample database is working. Do you see where my problem would lie?

Code:
Private Sub CustomerID_NotInList(NewData As String, Response As Integer)
 
DoCmd.OpenForm "entercustomer", , , , , acDialog, NewData
CustomerID.Undo
CustomerID.Requery
CustomerID = DLookup("ID", "tblCustomers", "ID='" & NewData & "'")
 
End Sub

Sample Database code (Actually works)
Code:
 ' Open the AddProduct form, with three additional arguments.
        DoCmd.OpenForm "AddProduct", , , , , acDialog, NewData
        
        ' Cancel the edit. That's because you need to refresh the list
        ' before you can select the new product.
        ProductID.Undo
        ' Refresh the list.
        ProductID.Requery
        ' Now find the ProductID for the newly added item using DLookup.
        ProductID = DLookup("ID", "Products", "ProductName='" & NewData & "'")
 
When you say it's not working what do you mean? It's throwing an error message?

Have you created a new thread about this?
 
Ok...when I type a customer's name in a combo box that doesn't match one of the existing customers, I've created an 'event procedure' in the 'not in list' property to pop up a new modal dialog form I created for entering information about a new customer.

First field I have for my customers is an ID field...which I have as a number. I would like this new form to prefill the ID field with the next number in sequence.

Maybe in order to first do that, I would have to change this to a autonumber field??
 

Users who are viewing this thread

Back
Top Bottom