Access MS Access Required Fields

Joined
Aug 10, 2012
Messages
5
Reaction score
0
Hi!

I have a form where some fields are not visible and will only be visible if certain conditions on the forms other fields are met. I also have a button named "DONE" that would close the form if all visible fields are all filled and open a message box if not. I tried to do this by code. I want my code to only affect the fields which is visible at the time the done button is clicked.

I tried this code on the done button's on click property but can't bring it to work correctly:

If [TRANSACTION MODE OF PAYMENT] = "CHECK" And IsNull([TRANSACTION BANK NAME]) = True Or IsNull([CHECK TYPE]) = True Then
MsgBox "Please fill up the Bank Name and the Check Type Sections before you proceed with this transaction.", vbExclamation, "Warning!"
ElseIf [TRANSACTION MODE OF PAYMENT] = "CARD" And IsNull([TRANSACTION BANK NAME]) = True Or IsNull([Combo184]) = True Then
MsgBox "Please fill up the Bank Name and the Card Type Sections before you proceed with this transaction.", vbExclamation, "Warning!"
ElseIf [CHECK TYPE] = "CROSS CHECK" And IsNull([Text186]) = True Or IsNull([LOCAL OR REGIONAL]) = True Then
MsgBox "Please fill up the all Bank Details before you proceed with this transaction.", vbExclamation, "Warning!"
ElseIf [Check161] = -1 And IsNull([BANK NAME]) = True Then
MsgBox "Please fill up the Bank Name Section before you proceed with this transaction.", vbExclamation, "Warning!"
ElseIf IsNull([TRANSACTION MONEY IN]) = True Then
MsgBox "Please fill up the Amount Paid Section before you proceed with this transaction.", vbExclamation, "WarnAing!"
ElseIf IsNull([STOCK#]) = True Then
MsgBox "Please fill up the Stock Number Section before you proceed with this transaction.", vbExclamation, "Warning!"
Else
DoCmd.RunMacro "ENTRY FORM SELLING FORM 2"
End If

Any help will be greatly appreciated. Thanks:)
 

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