Not sure why "tabbing" works but not otherwise...

F

Fred Boer

Hello

I have a form with two textboxes, txtAddress1 and txtAddress2. I am trying
to create code using the Form AfterUpdate event. Code looks like this:

If Not IsNull(me.txtAddress2) Then
If IsNull(me.txtAddress1) Then
me.txtAddress1=me.txtAddress2
me.txtAddress2=Null
Endif
Endif

The problem is as follows: if the user simply tabs to the next record, the
code runs properly. If the user, however, moves to the next record by either
clicking on the VCR button control, or by pressing "PageDown", the focus
remains on me.txtAddress2, and does not move to the next record.

Why does it work if you "tab" to the next record but not if you move to the
next record in other ways?
 
S

Stuart McCall

Fred Boer said:
Hello

I have a form with two textboxes, txtAddress1 and txtAddress2. I am trying
to create code using the Form AfterUpdate event. Code looks like this:

If Not IsNull(me.txtAddress2) Then
If IsNull(me.txtAddress1) Then
me.txtAddress1=me.txtAddress2
me.txtAddress2=Null
Endif
Endif

The problem is as follows: if the user simply tabs to the next record, the
code runs properly. If the user, however, moves to the next record by
either clicking on the VCR button control, or by pressing "PageDown", the
focus remains on me.txtAddress2, and does not move to the next record.

Why does it work if you "tab" to the next record but not if you move to
the next record in other ways?

--
Fred Boer - Amateur Access Enthusiast
Interests: Library software / Z39.50 / Web Services
Freeware Small Library Application available here:
http://www3.sympatico.ca/lornarourke/

Check the form's Cycle property. It should be set to 'All Records'.
 
F

Fred Boer

Yes, that worked. (Didn't seem to yesterday, but obviously I was doing
something wrong...). I still wonder why "tabbing" out of a form works
differently than "Page Down" or the built in navigation control...

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top