Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If Condition

Status
Not open for further replies.

chappie2

Technical User
May 18, 2004
29
US
I am struggling moving from macros to VB. Here is the setup.

I have three linked tables. tblGrantSum has info about all grants. Tables tblCTrack and tblFTrack have tracking information about some of the grants. Their is a one-to-one relatinship between tblGrantSum and the two tracking tables.

With a macro from a tblGrantSum form, I can open the associated tracking file. However, in a macro, I can't deal with the situation where there is not yet a record in the associated tracking table (MsgBox to ask to create a new record).

I assume I need to use an IF statement to deal with these two circumstances, but can't get the condition statement correct. In the macro, the where condition is:

[DLCDGrant#]=[Forms]![frmGrantSumDE].[GrantSumID#]

Is the IF statement the best choice?

Do I need to define the above fields as variables and use the variables in the condition to an IF statement?

Do I need to have the tracking tables and forms open for the IF statement to run?

Do I need to use a recordset command?

Thanks for any guidance and information you can provide.

Chappie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top