I'm new here and have a bit of a problem. I'm building a form in Access 2003 and have a piece of code I'm using to ensure that the correct values are saved in the table when each option is selected. This was the original code:
Expand|Select|Wrap|Line Numbers
- Private Sub AdministrativeSoundness_AfterUpdate()
- Select Case AdministrativeSoundness
- Case 1
- 'Green
- Me.AdministrativeSoundness = "15"
- Case 2
- 'Amber
- Me.AdministrativeSoundness = "7.5"
- Case 3
- 'Red
- Me.AdministrativeSoundness = "0"
- Case Else
- End Select
- End Sub
Expand|Select|Wrap|Line Numbers
- Private Sub AdministrativeSoundness_AfterUpdate()
- Select Case AdministrativeSoundness
- Case 1
- 'Green
- Me.AdministrativeSoundness = "15"
- Me.optASGreen.Visible = True
- Case 2
- 'Amber
- Me.AdministrativeSoundness = "7.5"
- Me.Option961.Visible = True
- Case 3
- 'Red
- Me.AdministrativeSoundness = "0"
- Me.Option963.Visible = True
- Case Else
- End Select
- End Sub
Can anyone tell me what I'm doing wrong? I know it's got something to do with the select case function, which I need in order to get the decimal value into the table, because it doesn't happen on the form tabs where I can just key the value I want directly into the option button's properties field. It only happens on the tabs where I need to use the select case statement.
I'm self-taught in Access, and until I started building this database, I'd managed to avoid VBA, so I'm not really sure that I'm going about this the right way.