A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Is it possible to make checkbox unavailable...



 
 
Thread Tools Display Modes
  #1  
Old December 11th, 2006, 05:47 PM posted to microsoft.public.access.forms
Adam
external usenet poster
 
Posts: 545
Default Is it possible to make checkbox unavailable...

.... when a specific value is selected in a text box?

Thanks,
Adam
  #2  
Old December 11th, 2006, 06:06 PM posted to microsoft.public.access.forms
Sprinks
external usenet poster
 
Posts: 531
Default Is it possible to make checkbox unavailable...

Adam,

Place the following code, modified to the name of your controls, in the
AfterUpdate event of the text or combo box, and in the form's OnCurrent event.

If Me![YourTextorComboBox].Value = SomeValue Then
Me![YourCheckbox].Enabled = False
End If

Sprinks

"Adam" wrote:

... when a specific value is selected in a text box?

Thanks,
Adam

  #3  
Old December 11th, 2006, 06:20 PM posted to microsoft.public.access.forms
Adam
external usenet poster
 
Posts: 545
Default Is it possible to make checkbox unavailable...

Thanks for the quick reply. Tried the following, threw a complie error. I
think it may be b/c the value I am trying to check for "NE AB" has a space?
Thoughts? What does the "ME!" represent? Thanks!

Private Sub Form_Open(Cancel As Integer)

If Me![NEAB].Value = NE AB Then
Me![IntendToKeepBrands].Enabled = False

End Sub

"Sprinks" wrote:

Adam,

Place the following code, modified to the name of your controls, in the
AfterUpdate event of the text or combo box, and in the form's OnCurrent event.

If Me![YourTextorComboBox].Value = SomeValue Then
Me![YourCheckbox].Enabled = False
End If

Sprinks

"Adam" wrote:

... when a specific value is selected in a text box?

Thanks,
Adam

  #4  
Old December 11th, 2006, 06:26 PM posted to microsoft.public.access.forms
Klatuu
external usenet poster
 
Posts: 7,074
Default Is it possible to make checkbox unavailable...

If Me![NEAB].Value = "NE AB" Then

Text values have to be surrounded with quote marks.

"Adam" wrote:

Thanks for the quick reply. Tried the following, threw a complie error. I
think it may be b/c the value I am trying to check for "NE AB" has a space?
Thoughts? What does the "ME!" represent? Thanks!

Private Sub Form_Open(Cancel As Integer)

If Me![NEAB].Value = NE AB Then
Me![IntendToKeepBrands].Enabled = False

End Sub

"Sprinks" wrote:

Adam,

Place the following code, modified to the name of your controls, in the
AfterUpdate event of the text or combo box, and in the form's OnCurrent event.

If Me![YourTextorComboBox].Value = SomeValue Then
Me![YourCheckbox].Enabled = False
End If

Sprinks

"Adam" wrote:

... when a specific value is selected in a text box?

Thanks,
Adam

  #5  
Old December 11th, 2006, 06:34 PM posted to microsoft.public.access.forms
Adam
external usenet poster
 
Posts: 545
Default Is it possible to make checkbox unavailable...

Debugger runs with the "Me![IntendToKeepBrands].Enabled = False" highlighted
when I load the form with the following. Ideas?

Private Sub Form_Open(Cancel As Integer)

If Me![NEAB].Value = "NE AB" Then
Me![IntendToKeepBrands].Enabled = False
End If

End Sub

"Klatuu" wrote:

If Me![NEAB].Value = "NE AB" Then

Text values have to be surrounded with quote marks.

"Adam" wrote:

Thanks for the quick reply. Tried the following, threw a complie error. I
think it may be b/c the value I am trying to check for "NE AB" has a space?
Thoughts? What does the "ME!" represent? Thanks!

Private Sub Form_Open(Cancel As Integer)

If Me![NEAB].Value = NE AB Then
Me![IntendToKeepBrands].Enabled = False

End Sub

"Sprinks" wrote:

Adam,

Place the following code, modified to the name of your controls, in the
AfterUpdate event of the text or combo box, and in the form's OnCurrent event.

If Me![YourTextorComboBox].Value = SomeValue Then
Me![YourCheckbox].Enabled = False
End If

Sprinks

"Adam" wrote:

... when a specific value is selected in a text box?

Thanks,
Adam

  #6  
Old December 11th, 2006, 06:35 PM posted to microsoft.public.access.forms
Adam
external usenet poster
 
Posts: 545
Default Is it possible to make checkbox unavailable...

.... the error is '438' Object doesn't support this property or method.

"Klatuu" wrote:

If Me![NEAB].Value = "NE AB" Then

Text values have to be surrounded with quote marks.

"Adam" wrote:

Thanks for the quick reply. Tried the following, threw a complie error. I
think it may be b/c the value I am trying to check for "NE AB" has a space?
Thoughts? What does the "ME!" represent? Thanks!

Private Sub Form_Open(Cancel As Integer)

If Me![NEAB].Value = NE AB Then
Me![IntendToKeepBrands].Enabled = False

End Sub

"Sprinks" wrote:

Adam,

Place the following code, modified to the name of your controls, in the
AfterUpdate event of the text or combo box, and in the form's OnCurrent event.

If Me![YourTextorComboBox].Value = SomeValue Then
Me![YourCheckbox].Enabled = False
End If

Sprinks

"Adam" wrote:

... when a specific value is selected in a text box?

Thanks,
Adam

  #7  
Old December 11th, 2006, 06:38 PM posted to microsoft.public.access.forms
Adam
external usenet poster
 
Posts: 545
Default Is it possible to make checkbox unavailable...

Got it!

Thanks for the help.

"Adam" wrote:

... the error is '438' Object doesn't support this property or method.

"Klatuu" wrote:

If Me![NEAB].Value = "NE AB" Then

Text values have to be surrounded with quote marks.

"Adam" wrote:

Thanks for the quick reply. Tried the following, threw a complie error. I
think it may be b/c the value I am trying to check for "NE AB" has a space?
Thoughts? What does the "ME!" represent? Thanks!

Private Sub Form_Open(Cancel As Integer)

If Me![NEAB].Value = NE AB Then
Me![IntendToKeepBrands].Enabled = False

End Sub

"Sprinks" wrote:

Adam,

Place the following code, modified to the name of your controls, in the
AfterUpdate event of the text or combo box, and in the form's OnCurrent event.

If Me![YourTextorComboBox].Value = SomeValue Then
Me![YourCheckbox].Enabled = False
End If

Sprinks

"Adam" wrote:

... when a specific value is selected in a text box?

Thanks,
Adam

  #8  
Old December 11th, 2006, 09:37 PM posted to microsoft.public.access.forms
Adam
external usenet poster
 
Posts: 545
Default Is it possible to make checkbox unavailable...

I thought i had it working, but now it's throwing an error and highlights the
second line. Ideas?

Private Sub Form_Open(Cancel As Integer)
If Me![ABNE].Value = "AB EA" Then
Me![IntendToKeepBrands].Enabled = False
Me![WillingToSellBrands].Enabled = False
Else
Me![IntendToKeepBrands].Enabled = True
Me![WillingToSellBrands].Enabled = True
End If

"Adam" wrote:

Got it!

Thanks for the help.

"Adam" wrote:

... the error is '438' Object doesn't support this property or method.

"Klatuu" wrote:

If Me![NEAB].Value = "NE AB" Then

Text values have to be surrounded with quote marks.

"Adam" wrote:

Thanks for the quick reply. Tried the following, threw a complie error. I
think it may be b/c the value I am trying to check for "NE AB" has a space?
Thoughts? What does the "ME!" represent? Thanks!

Private Sub Form_Open(Cancel As Integer)

If Me![NEAB].Value = NE AB Then
Me![IntendToKeepBrands].Enabled = False

End Sub

"Sprinks" wrote:

Adam,

Place the following code, modified to the name of your controls, in the
AfterUpdate event of the text or combo box, and in the form's OnCurrent event.

If Me![YourTextorComboBox].Value = SomeValue Then
Me![YourCheckbox].Enabled = False
End If

Sprinks

"Adam" wrote:

... when a specific value is selected in a text box?

Thanks,
Adam

  #9  
Old December 12th, 2006, 03:52 PM posted to microsoft.public.access.forms
Carl Rapson
external usenet poster
 
Posts: 517
Default Is it possible to make checkbox unavailable...

You may want to move this code into the Form_Current event, for two reasons:
recordsets aren't reliably available in the Form_Open event, and you will
probably want the checkboxes enabled/disabled on each record change. If you
really need to check/adjust field values /control properties when the form
loads, use the Form_Load event.

HTH,

Carl Rapson

"Adam" wrote in message
...
I thought i had it working, but now it's throwing an error and highlights
the
second line. Ideas?

Private Sub Form_Open(Cancel As Integer)
If Me![ABNE].Value = "AB EA" Then
Me![IntendToKeepBrands].Enabled = False
Me![WillingToSellBrands].Enabled = False
Else
Me![IntendToKeepBrands].Enabled = True
Me![WillingToSellBrands].Enabled = True
End If

"Adam" wrote:

Got it!

Thanks for the help.

"Adam" wrote:

... the error is '438' Object doesn't support this property or method.

"Klatuu" wrote:

If Me![NEAB].Value = "NE AB" Then

Text values have to be surrounded with quote marks.

"Adam" wrote:

Thanks for the quick reply. Tried the following, threw a complie
error. I
think it may be b/c the value I am trying to check for "NE AB" has
a space?
Thoughts? What does the "ME!" represent? Thanks!

Private Sub Form_Open(Cancel As Integer)

If Me![NEAB].Value = NE AB Then
Me![IntendToKeepBrands].Enabled = False

End Sub

"Sprinks" wrote:

Adam,

Place the following code, modified to the name of your controls,
in the
AfterUpdate event of the text or combo box, and in the form's
OnCurrent event.

If Me![YourTextorComboBox].Value = SomeValue Then
Me![YourCheckbox].Enabled = False
End If

Sprinks

"Adam" wrote:

... when a specific value is selected in a text box?

Thanks,
Adam



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:55 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.