Paul Maher
New member
- Local time
- Today, 13:02
- Joined
- Jul 5, 2002
- Messages
- 6
I originally posted this on the General Board, but have deleted that and reposted here:
(Another Question)
I'm writing a database to catalogue my video tapes.
I have a form listing my video tape numbers in a combo
box. Selecting a Cassette Number from the list and then
(via a command button) opening another form to show the
corresponding programmes associated with that Cassette.
This works fine using the following code:
--------------------------------------------------------
Private Sub OpenProgrammeDetailForm_Click()
On Error GoTo Err_OpenProgrammeDetailForm_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "FrmProgDetails"
stLinkCriteria = "[CassNo]=" & Me![CassNo]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_OpenProgrammeDetailForm_Click:
Exit Sub
Err_OpenProgrammeDetailForm_Click:
MsgBox Err.Description
Resume Exit_OpenProgrammeDetailForm_Click
End Sub
----------------------------------------------------
However, if there is no corresponding Record in the table
which feeds the Programme Details form, i'd like a message
box to pop up telling me this, AND the option to "add" a
new record in the Programmes Detail Form using the
original Number i selected in the combo box.
I hope this is clear?
If you can help, id be really grateful.
Thanks
(Another Question)
I'm writing a database to catalogue my video tapes.
I have a form listing my video tape numbers in a combo
box. Selecting a Cassette Number from the list and then
(via a command button) opening another form to show the
corresponding programmes associated with that Cassette.
This works fine using the following code:
--------------------------------------------------------
Private Sub OpenProgrammeDetailForm_Click()
On Error GoTo Err_OpenProgrammeDetailForm_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "FrmProgDetails"
stLinkCriteria = "[CassNo]=" & Me![CassNo]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_OpenProgrammeDetailForm_Click:
Exit Sub
Err_OpenProgrammeDetailForm_Click:
MsgBox Err.Description
Resume Exit_OpenProgrammeDetailForm_Click
End Sub
----------------------------------------------------
However, if there is no corresponding Record in the table
which feeds the Programme Details form, i'd like a message
box to pop up telling me this, AND the option to "add" a
new record in the Programmes Detail Form using the
original Number i selected in the combo box.
I hope this is clear?
If you can help, id be really grateful.
Thanks