Record/form help

  • Thread starter floyd33 via AccessMonster.com
  • Start date
F

floyd33 via AccessMonster.com

I have an expense database with a table for all employees and a table for the
expense report details (along with several other supporting tables). The
main form we use has a lookup box for the employee, which when clicked on,
brings up a form showing any/all expense reports that employee may have
completed, in a simplified datasheet form (subform). There is also a command
button in the footer that allows you to view the extended version of that
expense record attached to the row you clicked on from the datasheet view.
In this form, you can just view the expanded form view of the report you
clicked on (more fields visible for a complete report) or you can press
another command button to add a new report, which just brings up a new
expense record in form view for data entry.

A problem arises when you have an employee that has never added an expense
before. You choose their name from the drop down and then click the button
that says "expense report form" and it throws this message "You entered an
expression that has no value.†I am sure this is because there are no other
records associated with this person, but how do I fix it?

Thanks!
 
F

floyd33 via AccessMonster.com

What does "capture the error" mean? And I don't know much about VBA, do you
have sample code that would work?
Capture the error and return a different message and option. You would do it
in VBA.

Bonnie
http://www.dataplus-svc.com
I have an expense database with a table for all employees and a table for the
expense report details (along with several other supporting tables). The
[quoted text clipped - 15 lines]
 
B

bhicks11 via AccessMonster.com

Here's a VBA sample SUB structure:

Private Sub Whatever control on the form

This is where you run the macro or routine you want.


WHATEVER_Err:
MsgBox "Whatever message"
Resume Whatever_Exit
End Sub

Right click the control, select the EVENT tab, select the event you want to
run, click ... then select CODE. Put your code there.

Bonnie
http://www.dataplus-svc.com
What does "capture the error" mean? And I don't know much about VBA, do you
have sample code that would work?
Capture the error and return a different message and option. You would do it
in VBA.
[quoted text clipped - 7 lines]
 
Top