[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Syntax for reference control on subform datasheet

Posted on 2011-09-29
4
Medium Priority
?
290 Views
Last Modified: 2012-05-12
On the main form, there is a print button.  Before printing, I need to validate the subform field is not null.

subform is called "sbfrmTransaction"

control is called "cboEmployeeCode"

Here is my code:

If IsNull(???) Then
    MsgBox "Employee code must be filled in before printing."
    Exit Sub
End If

1) What would the syntax be in the IsNull(???)

2) Subform is a datasheet, do I have to loop through all the records to validate each of these fields?
0
Comment
Question by:gcgcit
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 total points
ID: 36814896

if  Isnull(me.sbfrmTransaction.form.cboEmployeeCode) then
    MsgBox "Employee code must be filled in before printing."
    Exit Sub
End If


note: just make sure that the subform control name is "sbfrmTransaction"

0
 
LVL 61

Expert Comment

by:mbizup
ID: 36814897
Give this a try:

If IsNull(me.sbfrmTransaction.Form.cboEmployeeCode) Then
0
 
LVL 61

Expert Comment

by:mbizup
ID: 36814907
< do I have to loop through all the records to validate each of these fields?>

If you are priniting a report, why not just create an Access report whose underlying query excludes nulls in that field (no code necessary)?
0
 

Author Closing Comment

by:gcgcit
ID: 36814930
Worked perfectly.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question