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
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