Visual Basic Question - Error Message

  • Thread starter Thread starter Kurt
  • Start date Start date
K

Kurt

I maintain a database and set-up a form to have my team enter data. I used
visual basic to add enhancements to a form where if they clicked a check box,
certain other fields would not be available. Problem is they seem to get an
error when they check the box, however I do not as the administrator of the
database.

Here is the VB code:
Private Sub Check42_Click()
'Event Procedure when Non-deficiency box is checked

If Check42.Value = True Then
'Sets combo boxes to N/A
Remediated.Value = "N/A"
[Updated Rating].Value = "N/A"

Remediated.Enabled = False
[Updated Rating].Enabled = False
Else
Remediated.Enabled = True
[Updated Rating].Enabled = True

Remediated.Value = Null
[Updated Rating].Value = Null
End If
End Sub
_____________________________________________________________________________________________
Sub form_current()
If Check42.Value = True Then
Remediated.Enabled = False
[Updated Rating].Enabled = False


Can someone let me know if I have any errors in this visual basic code that
could be causing the Access error and forcing my team to shut down Access.
 
Microsoft Office Access has encountered a problem and needs to close. We are
sorry for the inconvenience. Then, Access would shut down.

Steve Schapel said:
Kurt,

So, what is the error message that your users are getting?

--
Steve Schapel, Microsoft Access MVP


Kurt said:
I maintain a database and set-up a form to have my team enter data. I used
visual basic to add enhancements to a form where if they clicked a check
box,
certain other fields would not be available. Problem is they seem to get
an
error when they check the box, however I do not as the administrator of
the
database.

Here is the VB code:
Private Sub Check42_Click()
'Event Procedure when Non-deficiency box is checked

If Check42.Value = True Then
'Sets combo boxes to N/A
Remediated.Value = "N/A"
[Updated Rating].Value = "N/A"

Remediated.Enabled = False
[Updated Rating].Enabled = False
Else
Remediated.Enabled = True
[Updated Rating].Enabled = True

Remediated.Value = Null
[Updated Rating].Value = Null
End If
End Sub
_____________________________________________________________________________________________
Sub form_current()
If Check42.Value = True Then
Remediated.Enabled = False
[Updated Rating].Enabled = False


Can someone let me know if I have any errors in this visual basic code
that
could be causing the Access error and forcing my team to shut down Access.

.
 
Microsoft Office Access has encountered a problem and needs to close. We are
sorry for the inconvenience.

Once this message appeared, it showed a bit of the VB screen saying
something was broken and then would shut down Access. We have resorted to
taking out the code and just moving through the form, however the VB code
would be helpful if you can help me fix it. Thanks.

Steve Schapel said:
Kurt,

So, what is the error message that your users are getting?

--
Steve Schapel, Microsoft Access MVP


Kurt said:
I maintain a database and set-up a form to have my team enter data. I used
visual basic to add enhancements to a form where if they clicked a check
box,
certain other fields would not be available. Problem is they seem to get
an
error when they check the box, however I do not as the administrator of
the
database.

Here is the VB code:
Private Sub Check42_Click()
'Event Procedure when Non-deficiency box is checked

If Check42.Value = True Then
'Sets combo boxes to N/A
Remediated.Value = "N/A"
[Updated Rating].Value = "N/A"

Remediated.Enabled = False
[Updated Rating].Enabled = False
Else
Remediated.Enabled = True
[Updated Rating].Enabled = True

Remediated.Value = Null
[Updated Rating].Value = Null
End If
End Sub
_____________________________________________________________________________________________
Sub form_current()
If Check42.Value = True Then
Remediated.Enabled = False
[Updated Rating].Enabled = False


Can someone let me know if I have any errors in this visual basic code
that
could be causing the Access error and forcing my team to shut down Access.

.
 
Kurt -

I don't know if this is the issue, but you seem to be referencing controls
on the form without the form reference. For example,
Remediated.Value = "N/A"
should be
Me.Remediated.Value = "N/A"
if Remediated is a control on the form.

--
Daryl S


Kurt said:
Microsoft Office Access has encountered a problem and needs to close. We are
sorry for the inconvenience.

Once this message appeared, it showed a bit of the VB screen saying
something was broken and then would shut down Access. We have resorted to
taking out the code and just moving through the form, however the VB code
would be helpful if you can help me fix it. Thanks.

Steve Schapel said:
Kurt,

So, what is the error message that your users are getting?

--
Steve Schapel, Microsoft Access MVP


Kurt said:
I maintain a database and set-up a form to have my team enter data. I used
visual basic to add enhancements to a form where if they clicked a check
box,
certain other fields would not be available. Problem is they seem to get
an
error when they check the box, however I do not as the administrator of
the
database.

Here is the VB code:
Private Sub Check42_Click()
'Event Procedure when Non-deficiency box is checked

If Check42.Value = True Then
'Sets combo boxes to N/A
Remediated.Value = "N/A"
[Updated Rating].Value = "N/A"

Remediated.Enabled = False
[Updated Rating].Enabled = False
Else
Remediated.Enabled = True
[Updated Rating].Enabled = True

Remediated.Value = Null
[Updated Rating].Value = Null
End If
End Sub
_____________________________________________________________________________________________
Sub form_current()
If Check42.Value = True Then
Remediated.Enabled = False
[Updated Rating].Enabled = False


Can someone let me know if I have any errors in this visual basic code
that
could be causing the Access error and forcing my team to shut down Access.

.
 
Back
Top