Good Morning,
I was wondering if anyone could help me out with a small problem I am having. Currently I have a form that holds all information for each "Club". When a button on this form is clicked a pop-up form opens showing the "checklist" for each club, which is stored on a separate table but linked via "ClubID"
If I add a new club however, this link does not open the form in data entry mode, it gives an error then shows a blank pop-up box.
What I would like to do is to have the button open the form in data entry mode if the club does not have an associated record in the checklist table.
so far I have got this, but it does not see an error until the other form is loaded, and when I add the "addnew" error part to the other form it still shows a blank pop-up form.
Any help would be greatly appreciated!
I was wondering if anyone could help me out with a small problem I am having. Currently I have a form that holds all information for each "Club". When a button on this form is clicked a pop-up form opens showing the "checklist" for each club, which is stored on a separate table but linked via "ClubID"
If I add a new club however, this link does not open the form in data entry mode, it gives an error then shows a blank pop-up box.
What I would like to do is to have the button open the form in data entry mode if the club does not have an associated record in the checklist table.
Code:
Private Sub Checklist_Click()
On Error GoTo AddNew
DoCmd.OpenForm "checkt", , , "[ClubID]=" & Me.OrgID
On Error GoTo AddNew
Exit Sub
AddNew:
Dim AddNew As DAO.Recordset
Set AddNew = CurrentDb.OpenRecordset("SELECT * FROM [dbo.checkt]")
AddNew.AddNew
AddNew![ClubID] = Me.OrgID
AddNew![OrgName] = Me.OrgName
AddNew.Update
MsgBox "Added To DB, Please click Checklist button again", , "Completed"
End Sub
so far I have got this, but it does not see an error until the other form is loaded, and when I add the "addnew" error part to the other form it still shows a blank pop-up form.
Any help would be greatly appreciated!