namdam13
Technical User
- May 20, 2009
- 7
Hi People,
I can not work what i am doing wrong here. I have a subform with on textbox on it. The two forms are linked.
The subform it is generated from a query from the main form.
I want it to run one macro if their is a value in the subform textbox and to run another macro if the value is Null.
I have tried several way of writing the reference but it always acts as if there is a Null value. Which i assume means its not finding the TextBox(or should that be control box properly.
After a bit of research i found the format as listed in the code below and got the following error meassage.
"Object doesn't support the propety or method"
Where am i going wrong? is there an cleaner way to do this??
Thanks
MARK
I can not work what i am doing wrong here. I have a subform with on textbox on it. The two forms are linked.
The subform it is generated from a query from the main form.
I want it to run one macro if their is a value in the subform textbox and to run another macro if the value is Null.
I have tried several way of writing the reference but it always acts as if there is a Null value. Which i assume means its not finding the TextBox(or should that be control box properly.
After a bit of research i found the format as listed in the code below and got the following error meassage.
"Object doesn't support the propety or method"
Where am i going wrong? is there an cleaner way to do this??
Code:
Private Sub Create_New_TWC_BT_Click()
Dim stDocName As String
On Error GoTo Err_Create_New_TWC_BT_Click
DoCmd.SetWarnings False
'Forms![main form name]![subform control name].Forms![control name]
If IsNull(Forms![TWC_Edit_and_Print_FM]![TWC_No_Lookup_FM].Forms![TWC_ID]) Then
stDocName = "Create_TWC_MCR"
DoCmd.RunMacro stDocName
Else
Call TWCExistMessage
End If
Exit_Create_New_TWC_BT_Click:
Exit Sub
Err_Create_New_TWC_BT_Click:
MsgBox Err.Description
DoCmd.SetWarnings True
Resume Exit_Create_New_TWC_BT_Click
End Sub
Thanks
MARK