Please show us your code.Originally Posted by wedd
Please show us your code.Originally Posted by wedd
No errors are appearing. Its just when I click on the various checkboxes thedifferent prices of the deposits son't appear. A similar thing occured when I first opened the database you sent me...however I changed the trust settings and it worked well.
Here is my code:
Private Sub fraOrganisations_AfterUpdate()
Dim curDeposit As Currency
Dim strError As String
Select Case Me.fraOrganisations
Case 1 ' Maitland Park Sports Centre
curDeposit = 100#
Case 2 ' Queens Crescent Community Centre
curDeposit = 200#
Case 3 ' Fleet Community Centre
curDeposit = 100#
Case 4 ' Equipment
curDeposit = 100#
Case Else ' oops
strError = "unexpected value for fraOrganisations: " & _
Me.fraOrganisations
End Select
If Len(strError) > 0 Then
MsgBox strError
Else
Me.txtDeposit = curDeposit
End If
End Sub
I've included equipment as a new option. Thanks for your help
I am using access 2007. I'm not sure if that could be causing the issue...
OK, I will assume your database is stored in a trusted location. Let me know if we need to discuss that point further.Originally Posted by wedd
I don't see anything wrong with the AfterUpdate code. And it looks to me like you added equipment properly.
Add a MsgBox line to your code as I indicated below. The reason for this is to determine whether fraOrganisations_AfterUpdate is evaluated at all after you select a different check box on the form.
Since you're running the database from a trusted location, the only other reason I can suggest for why fraOrganisations_AfterUpdate wouldn't run is if the option group frame is not named fraOrganisations.
Anyway, the first step is for you to tell us whether or not you see the MsgBox.
[vba]Private Sub fraOrganisations_AfterUpdate()
Dim curDeposit As Currency
Dim strError As String
MsgBox "fraOrganisations_AfterUpdate active"
Select Case Me.fraOrganisations
Case 1 ' Maitland Park Sports Centre
curDeposit = 100#
Case 2 ' Queens Crescent Community Centre
curDeposit = 200#
Case 3 ' Fleet Community Centre
curDeposit = 100#
Case 4 ' Equipment
curDeposit = 100#
Case Else ' oops
strError = "unexpected value for fraOrganisations: " & _
Me.fraOrganisations
End Select
If Len(strError) > 0 Then
MsgBox strError
Else
Me.txtDeposit = curDeposit
End If
End Sub[/vba]