Solved If ComboBox is Yes, TextBox must Not be blank

VzqCrs

Member
Local time
Today, 01:49
Joined
Nov 15, 2021
Messages
54
Hi All!

I want to add as part of a datacheck when the user clicks on Submit and Close. I have coding already there for other things, but how do I code for this?

i.e. If Me.bFinancial = -1 then Me.txtFinancial not null

I know that's not right, but I'm having trouble writing in the Not Null of Not Blank - can someone lead me the right way?

Thank you in advance!
 
You don't need the Yes\No field, you should just check the value of the text box"
Code:
If Isnull(Me.txtFinancial) Then
    MsgBox "Sorry, you need to add Financial"
End if
Cheers,
 
Maybe something like:

Code:
If Me.bFinancial AND IsNull(Me.txtFinancial) Then
 
bFinancial is a Yes/No combo box and is a required field that is defaulted to No, but if Yes is selected then txtFinancial needs something
 
bFinancial is a Yes/No combo box and is a required field that is defaulted to No, but if Yes is selected then txtFinancial needs something
Did you try what I suggested?
 
Does the "like" mean that you heard me and are moving the code?
Yes, I moved all the datachecks to the BeforeUpdate event and the AppendQueries etc to the AfterUpdate event and the Submit button will only save and requery the form. Thanks for the advice!
 

Users who are viewing this thread

Back
Top Bottom