Help with VBA code to validate form controls (1 Viewer)

abette

Member
Local time
Today, 08:52
Joined
Feb 27, 2021
Messages
85
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.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 05:52
Joined
Oct 29, 2018
Messages
21,494
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.
 

abette

Member
Local time
Today, 08:52
Joined
Feb 27, 2021
Messages
85
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.
 

abette

Member
Local time
Today, 08:52
Joined
Feb 27, 2021
Messages
85
DBGuy would you help me with the validation code needed for the next steps?
 

abette

Member
Local time
Today, 08:52
Joined
Feb 27, 2021
Messages
85
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 :)
 

abette

Member
Local time
Today, 08:52
Joined
Feb 27, 2021
Messages
85
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?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 05:52
Joined
Oct 29, 2018
Messages
21,494
Hi. Are you able to post a small/sample copy of your db?
 

abette

Member
Local time
Today, 08:52
Joined
Feb 27, 2021
Messages
85
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.
 

Attachments

  • Claims Review Database - Copy.zip
    178.8 KB · Views: 121

abette

Member
Local time
Today, 08:52
Joined
Feb 27, 2021
Messages
85
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

Top Bottom