Help with VBA code to validate form controls

Hi. But you didn't answer my question. Can each member id have more than one authorization number?
I am SO sorry - yes, a member ID may have several AuthNum's (when looking at the dbo_tdAuthorization table) but the authorizations can have different start and end dates. So when I look at the Authorization's table I see multiple recs with different auths but the same Member ID.
 
I am SO sorry - yes, a member ID may have several AuthNum's (when looking at the dbo_tdAuthorization table) but the authorizations can have different start and end dates. So when I look at the Authorization's table I see multiple recs with different auths but the same Member ID.
In that case, have you considered using dropdowns instead of textboxes? Dropdowns sort of auto-validate the user input, because it won't allow invalid, non-existent entries.
 
In that case, have you considered using dropdowns instead of textboxes? Dropdowns sort of auto-validate the user input, because it won't allow invalid, non-existent entries.
Hi - there's just too many records for a drop down. We are talking about almost 500,000! The SQL tables are populated from a portal application.
 
DBGuy would you help me with the validation code needed for the next steps?
 
In that case, have you considered using dropdowns instead of textboxes? Dropdowns sort of auto-validate the user input, because it won't allow invalid, non-existent entries.
Good morning,
I am at it again with this code -
would you please tell me what I am doing wrong with this?

If Me.MemberID > 0 And Me.AuthNumber > "" Then
If Me.MemberID = Table.dbo_tdAuthorization.[MemberID] And Me.AuthNumber = Table.dbo_tdAuthorization.[AuthNum] Then
' MsgBox "Member ID and Auth Number match in CYBER."
Else
MsgBox "Member ID and Auth Number do not match in CYBER."
End If
End If

It's bombing on the 2nd line boldfaced. I am guessing it's not recognizing the table/field because I don't have it defined? I just don't know what the code should be since I am not a VBA programmer. I am trying to learn! LOL
Thank you for your help :)
 
Good morning,
I am at it again with this code -
would you please tell me what I am doing wrong with this?

If Me.MemberID > 0 And Me.AuthNumber > "" Then
If Me.MemberID = Table.dbo_tdAuthorization.[MemberID] And Me.AuthNumber = Table.dbo_tdAuthorization.[AuthNum] Then
' MsgBox "Member ID and Auth Number match in CYBER."
Else
MsgBox "Member ID and Auth Number do not match in CYBER."
End If
End If

It's bombing on the 2nd line boldfaced. I am guessing it's not recognizing the table/field because I don't have it defined? I just don't know what the code should be since I am not a VBA programmer. I am trying to learn! LOL
Thank you for your help :)
I am getting this error
1622648728210.png


Is there a Set command for the Table object?
 
Hi. Are you able to post a small/sample copy of your db?
 
Here you go. I had to clean up the data and sql links so all the tables are local.
Hi. Are you able to post a small/sample copy of your db?
Hi theDBguy - I sent you a copy of a modified version of my database yesterday. Please let me know if you received it.
Thank you for your help with this endeavor. I really appreciate it! Again...I am not a VBA person so this is all new to me!
 

Users who are viewing this thread

Back
Top Bottom