Examining records in a subform

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have one subform with a few records, each with a combo box that the user
selects a value from. I want to prevent the user from performing a certain
action (via clicking a button) if any of the combo box values for the records
in the subform are null. Is there any way to check these values from my main
form's command button's code?

Thanks, all.

-ndalton
 
If the subform's table has a relationship to the main form's table, you
could use this kind of logic:

Dim varResult As Variant
Dim strWhere As String
strWhere = "([MyForeignKey] = " & Nz(Me.[MyMainID], 0) & _
") AND ([MyComboField] Is Null)"
varResult = DLookup("ID", "MySubformTable", strWhere)
If Not IsNull(varResult) Then
MsgBox "Not allowed"
End If
 
AUTO-REPLY From George Levitt

Please allow this to confirm a system receipt of your e-mail.

I am out of the office until Wednesday morning (1/12/05) and will not be
reviewing or responding to email or voicemail until that time.

I look forward to replying to your message on Wednesday.

Thanks and warmest regards, George
 
AUTO-REPLY From George Levitt

Please allow this to confirm a system receipt of your e-mail.

I am out of the office until Wednesday morning (1/12/05) and will not be
reviewing or responding to email or voicemail until that time.

I look forward to replying to your message on Wednesday.

Thanks and warmest regards, George
 

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

Back
Top