Silly event question?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I feel a little silly asking this, but I have a form that is not bound to any
table or data, which is my intent. I've implemented event coding, but the
code never fires. I'm trying to use the Enter() and LostFocus() events for
different things; I know it's not firing because I'm testing with msgbox and
code breaks.

This is probably the silly part: Does a form have to be bound to a table or
other data to handle event processing? If so, that seems a pretty basic
functionality I missed; is that noted somewhere obvious in the Help or
elsewhere?

Thanks much.
 
You have not told us WHEN you want the code to fire.

No, it does not need to be bound to use code.
 
Sorry, Rick. I thought the event names I used were evident enough.

It really should be simple enough; I just have a some combo and text boxes.
For the combos, I want to invoke the DropDown method unpon Enter(), then upon
LostFocus(), lookup up a value using DLookup and populate a text box. This
is stuff I've done before, so I feel like I know how to do it, but I'm
completely flummoxed by the failure of any even to fire.

Good to know the form doesn't have to be bound. If you've any other ideas,
I'm all eyes, otherwise, I'll just keep plugging.

Thanks.
 
pvdalen said:
I feel a little silly asking this, but I have a form that is not
bound to any table or data, which is my intent. I've implemented
event coding, but the code never fires. I'm trying to use the
Enter() and LostFocus() events for different things; I know it's not
firing because I'm testing with msgbox and code breaks.

This is probably the silly part: Does a form have to be bound to a
table or other data to handle event processing? If so, that seems a
pretty basic functionality I missed; is that noted somewhere obvious
in the Help or elsewhere?

Thanks much.

A few events won't fire, because there will be no reason for them to,
but most events, including Enter and LostFocus, should fire. Are you
sure you have the relevant event properties set to "[Event Procedure]"?
 
Yep. They sure are.

Thanks.

Dirk Goldgar said:
pvdalen said:
I feel a little silly asking this, but I have a form that is not
bound to any table or data, which is my intent. I've implemented
event coding, but the code never fires. I'm trying to use the
Enter() and LostFocus() events for different things; I know it's not
firing because I'm testing with msgbox and code breaks.

This is probably the silly part: Does a form have to be bound to a
table or other data to handle event processing? If so, that seems a
pretty basic functionality I missed; is that noted somewhere obvious
in the Help or elsewhere?

Thanks much.

A few events won't fire, because there will be no reason for them to,
but most events, including Enter and LostFocus, should fire. Are you
sure you have the relevant event properties set to "[Event Procedure]"?

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
Do you get any compile errors when you click Debug -> Compile? Have you
checked for broken references? (In the VB Editor, click Tools ->
References..., and look for any references in the list that are marked
MISSING.)

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

pvdalen said:
Yep. They sure are.

Thanks.

Dirk Goldgar said:
pvdalen said:
I feel a little silly asking this, but I have a form that is not
bound to any table or data, which is my intent. I've implemented
event coding, but the code never fires. I'm trying to use the
Enter() and LostFocus() events for different things; I know it's not
firing because I'm testing with msgbox and code breaks.

This is probably the silly part: Does a form have to be bound to a
table or other data to handle event processing? If so, that seems a
pretty basic functionality I missed; is that noted somewhere obvious
in the Help or elsewhere?

Thanks much.

A few events won't fire, because there will be no reason for them to,
but most events, including Enter and LostFocus, should fire. Are you
sure you have the relevant event properties set to "[Event
Procedure]"?
 
Un-friggin'-believable

I never even thought to complie it. That was it.

Just for the board's edification,if anyone else is actually this careless in
the future, I rane the compiler and got a message:

"Procedure declaration does not match description of event or procedure
having the same name", and it highlighted the line:

Private Sub txtGenM4_LostFocus(Cancel as Integer)

Well, I removed the "Cancel as Integer" and everything was fine. It seemed
when I was creating the procedures, I selected "BeforeUpdate" instead of
"LostFocus" in the dropdown for the object. The BeforeUpdate comes with
(Cancel As Integer), and when I changed "BeforeUpdate" to "LostFocus", I
negelcted to remove "Cancel as Integer" from between the parentheses.

Stoopid me.

Thanks again, Dirk.



Dirk Goldgar said:
Do you get any compile errors when you click Debug -> Compile? Have you
checked for broken references? (In the VB Editor, click Tools ->
References..., and look for any references in the list that are marked
MISSING.)

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

pvdalen said:
Yep. They sure are.

Thanks.

Dirk Goldgar said:
I feel a little silly asking this, but I have a form that is not
bound to any table or data, which is my intent. I've implemented
event coding, but the code never fires. I'm trying to use the
Enter() and LostFocus() events for different things; I know it's not
firing because I'm testing with msgbox and code breaks.

This is probably the silly part: Does a form have to be bound to a
table or other data to handle event processing? If so, that seems a
pretty basic functionality I missed; is that noted somewhere obvious
in the Help or elsewhere?

Thanks much.

A few events won't fire, because there will be no reason for them to,
but most events, including Enter and LostFocus, should fire. Are you
sure you have the relevant event properties set to "[Event
Procedure]"?
 
Back
Top