Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

code

Status
Not open for further replies.

Ielamrani

MIS
Jul 7, 2005
183
US
Can anyone tell me why this code is not working? Thanks in advance

Private Sub Report_Open(Cancel As Integer)
If Text35 = 'CONTRACT TYPE: GROUP*' Then
Check39 = True
Else
Check43 = True
End If
End Sub
 
How about:

If Me.Text35 = "CONTRACT TYPE: GROUP*" Then

Check39 = True
Else
Check43 = True
End If
End Sub
 
I think you will find that the Open event is not suitable for setting values of controls. The Page event may be more suitable. I am not sure whether you intended to use 'Like' or 'equals'.
 
it still does not like this line:

If Me.Text35 = "CONTRACT TYPE: GROUP*" Then

thanks
 
I have tested this:
Code:
Private Sub Report_Activate()
If Me.Text35 = "CONTRACT TYPE: GROUP*" Then
Check2 = True
Else
Check4 = True
End If
End Sub
In Access 2000, where Text35 = CONTRACT TYPE: GROUP*

Also
Code:
Private Sub Report_Activate()
If Me.Text35 Like "CONTRACT TYPE: GROUP*" Then
Check2 = True
Else
Check4 = True
End If
End Sub
Where Text35 = CONTRACT TYPE: GROUP12

Both of these seemed to work ok. [ponder]
 
Are you sure you have Text35 field written exactly like
CONTRACT TYPE: GROUP and not like CONTRACT TYPE: GROUP* or something else. How are you entering this field? Data entry or combobox selection?
 
You're right Text35 was spelled Txt35. Now the code works thanks so much for you help
Ismail
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top