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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

is there a reason why this wont work

Status
Not open for further replies.

ghayman73

Technical User
Jul 3, 2002
55
FR
i am trying to open a form and have certain tick boxes enabled or not depending on a value in a text box using this code

Private Sub Form_Open(Cancel As Integer)
If Forms![USA_form]![how_many].Value > 14 Then
Forms![USA_form]![Dirt_cheap_keyword].Enabled = False
Else
Forms![USA_form]![Dirt_cheap_keyword].Enabled = True
End If
End Sub

but it doesnt work am i over looking something or is this not possible

thanks for looking at this

grant
 
" ... doesn't work ... "


Is a bit sketchy. At a (?S?)WAG, I would think it MIGHT work on the startup just not on subsquent records.


MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
apologise for "doesnt work"

i will check if it is working on the first record by altering a few values


if so is there any way of getting it to check subsequent records at start up, however i do have over 11 thousand records if that alters things.

thanks for your time

grant
 
it is working only one the first record but it disables all other records also.
 
then, movve the content of hte sub to the on activate event. Load 'fires' only (once) when the object (e.g. form) is loaded, activate occurs on each (and every) change of record traversal.

Since this is obviously a "Forms" module procedure, you can replace Forms![USA_form! with Me. and save a few key strokes.

Further, the liberal application of hte ubiquitous {F1} key would be in your interest. It is generally FASTER than waiting for replies from public bulletin boards, ALWAYS has accurate information, and MAY (with liberal application) teach you a lot about development of applications. It is also more polite than some answers which you MIGHT recieve via public postings.



MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top