I am new to Access and am currently creating a database system to manage program booking, invoices & scheduling. I have been able to learn the basics pretty easily and have a solid grasp of how to create forms, link them to different parts of a database, etc.
Where I hit stumbling blocks is the coding. So far I've been able to find solutions to many of my problems online, but now nothing works.
Literally. All of the VBA event procedure codes that I had written or copied from online no longer work--even if they did just a few days ago.
Here are two examples of the codes that were working and no longer are:
**Example 1 (This is so that if a box is checked, the billing contact info is copied over to the event contact info automatically)***
Private Sub Check85_AfterUpdate()
If Me.Check85 = True Then
Me.[Event_Street] = Me.[Billing_Street]
Me.[Event_City] = Me.[Billing_City]
Me.[Event_State] = Me.[Billing_State]
Me.[Event_Zip] = Me.[Billing_Zip]
End If
End Sub
***Example 2 (This is to create a button that will open a print preview of a report that just relates to the current entry--not all entries)***
Private Sub cmdPrintEdReport_Click()
Dim strWhere As String
If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If
If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[ID] = " & Me.[ID]
DoCmd.OpenReport "ZM_Education_Invoice", acViewPreview, , strWhere
End If
End Sub
Does anyone have any suggestions of where things got messed up? Thanks.
Where I hit stumbling blocks is the coding. So far I've been able to find solutions to many of my problems online, but now nothing works.
Literally. All of the VBA event procedure codes that I had written or copied from online no longer work--even if they did just a few days ago.
Here are two examples of the codes that were working and no longer are:
**Example 1 (This is so that if a box is checked, the billing contact info is copied over to the event contact info automatically)***
Private Sub Check85_AfterUpdate()
If Me.Check85 = True Then
Me.[Event_Street] = Me.[Billing_Street]
Me.[Event_City] = Me.[Billing_City]
Me.[Event_State] = Me.[Billing_State]
Me.[Event_Zip] = Me.[Billing_Zip]
End If
End Sub
***Example 2 (This is to create a button that will open a print preview of a report that just relates to the current entry--not all entries)***
Private Sub cmdPrintEdReport_Click()
Dim strWhere As String
If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If
If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[ID] = " & Me.[ID]
DoCmd.OpenReport "ZM_Education_Invoice", acViewPreview, , strWhere
End If
End Sub
Does anyone have any suggestions of where things got messed up? Thanks.