Question

Locked

VBA Question

By omnknt232006 ·
I am working in access 2003 and am having difficulty thinking of the best way to accomplish this thing. I have a form that has several combo boxes and text boxes that indicate the amount of money spent on something. When the users put in the data they have to put in a fiscal year, account code (general text box), fund code (two digit value that is selected from a combo box) and a dollar amount. There is room on the form for ten such entries into the table. What I would like to program is that when the add record button is clicked I want the routine to evaluate whether there is an amount in the amount box. If there is no amount it can go on to the next routine but if there is an amount I want to check to make sure there is a fund code to accompany it in the table. I was wondering what the best way to accomplish this would be. Obviously it would need to be some kind of if statement but I am just not sure how to phrase the coding. Any help you can give me would be appreciated.

This conversation is currently closed to new comments.

1 total post (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

I must be missing something...

by john.a.wills In reply to VBA Question

if isnull(me.amount) _
then
else
if isnull (me.fundcode) _
then
demand fund code
end if
end if

Something pretty close to the above should do it.

Back to Software Forum
1 total post (Page 1 of 1)  

Related Discussions

Related Forums