N
NasaDBGuy
Running Access 2003
I'm trying to loop through all the text boxes of my form to assign my user
defined sub when the dirty event occurs. Here' what I have so far:
public sub textValue(ctrl as control)
dim message as string
message = ctrl.value
msgbox = message
end sub
public sub textLoop()
dim ctlLoop as control
For each ctlLoop in Forms!spacecraft.form.controls
if typeof ctlLoop is textbox then
ctlLoop.OnDirty = "[textValue(ctlLoop)]" 'this line of code does not work
'when I fire the dirty event for that control Access tells me it is looking
for a 'macro that does not exist.
end if
next ctlLoop
end sub
the textLoop() and textValue() subs are written in a module. I call the
textLoop sub when the form loads. spacecraft is the name of my form.
This is similar to code I got from access help on the OnUndo property:
Dim ctlLoop As Control
For Each ctlLoop In Forms(0).Controls
If ctlLoop.Type = acTextBox Then
ctlLoop.OnUndo = "[Event Procedure]"
End If
Next ctlLoop
Any help would be appreciated.
I'm trying to loop through all the text boxes of my form to assign my user
defined sub when the dirty event occurs. Here' what I have so far:
public sub textValue(ctrl as control)
dim message as string
message = ctrl.value
msgbox = message
end sub
public sub textLoop()
dim ctlLoop as control
For each ctlLoop in Forms!spacecraft.form.controls
if typeof ctlLoop is textbox then
ctlLoop.OnDirty = "[textValue(ctlLoop)]" 'this line of code does not work
'when I fire the dirty event for that control Access tells me it is looking
for a 'macro that does not exist.
end if
next ctlLoop
end sub
the textLoop() and textValue() subs are written in a module. I call the
textLoop sub when the form loads. spacecraft is the name of my form.
This is similar to code I got from access help on the OnUndo property:
Dim ctlLoop As Control
For Each ctlLoop In Forms(0).Controls
If ctlLoop.Type = acTextBox Then
ctlLoop.OnUndo = "[Event Procedure]"
End If
Next ctlLoop
Any help would be appreciated.