RichardP1978
Registered User.
- Local time
- Today, 02:14
- Joined
- Nov 14, 2006
- Messages
- 89
I have a main form, which has a subform on it.
THe Main form is the main page for the clients, and the subform holds hyperlinks to PDF files (letters we have recieved on a client). This works fine.
I am trying to get it so when a document gets inserted in to the subform, a date is automatically inserted in to a field.
When testing the subform on its own, opened directly from the database window, it inserts the date with no problem. However, when trying to do the same in the subform when it is opened as part of the main form, VBA crashes out saying it cant find the subform.
I think I understand why it is crashing out, as the subform isnt actually open open, but its a case of how do I reference it.
This is the code that I am trying to use, which as I said works fine when the subform is opened exclusively, not through the main form.
Hope someone can help.
If IsNull(Forms![subfrmDocuments]![DocumentAddedDate]) = True Then
Forms![subfrmDocuments]![DocumentAddedDate] = Date
Else
End If
THe Main form is the main page for the clients, and the subform holds hyperlinks to PDF files (letters we have recieved on a client). This works fine.
I am trying to get it so when a document gets inserted in to the subform, a date is automatically inserted in to a field.
When testing the subform on its own, opened directly from the database window, it inserts the date with no problem. However, when trying to do the same in the subform when it is opened as part of the main form, VBA crashes out saying it cant find the subform.
I think I understand why it is crashing out, as the subform isnt actually open open, but its a case of how do I reference it.
This is the code that I am trying to use, which as I said works fine when the subform is opened exclusively, not through the main form.
Hope someone can help.
If IsNull(Forms![subfrmDocuments]![DocumentAddedDate]) = True Then
Forms![subfrmDocuments]![DocumentAddedDate] = Date
Else
End If