Tab Control Jumps After Field Update

D

doodle

Greeting again.
windows cp, access 97 (i know, i know...)

I have a form with a tab control.
- 4 pages on tab control
-problem field is on page one which contains problem field and a
subform
-field name is cmbCustNum (unbound combo box)
-row source is a query (qryCustomer)(Limit to List)
-enabled yes, locked no

Events
-none on individual pages
-before update event of problem field: Me.ContactName.Value = " "
-after update event of problem field: Me.ContactName.Requery
-form load: Me.CustNum.SetFocus
-form timer: Me.sfrmCustContacts.Requery

page one name = Customer Address
page two name = Order Detail

Behavior:

-Enter customer number that is in list (1234567) - though behavior is
the same for all #'s
-Hit tab, enter or select value from combo box
Instead of moving to the subform on the same page, which is what the
tab order is set to do, it jumps to the 3rd page in the tab control, to
a field in the middle of the form called txtOurRef

What I tried:
1. Commented out Before and After Update events of probelms field, same
issue.
2. Repaired and Compacted database, same issue.



Any ideas?

-doodle
 
D

doodle

OK. I figured out what it is but I need help fixing it. It is the
..requery that is throwing it off.

What I need to requery: cmbContactName (Page two)

Why? Page two contains a datasheet that users can add new contacts to.
The datasheet also contains all of the contacts listed for that
customer previously. The cmbContactName field allows the user to select
which contact called in the order.

cmbContactName rowsource is qryCustomer:

SELECT ContactName
FROM tblCustContacts
WHERE CustNum = Forms!frmOrderEntry!CustNum;

I had the requery on afterupdate for cmbCustNum to update the combo box
if the user selects a different customer and I had the requery on the
timer to update the combo box if the user adds a new contact to the
listbox.

anyone have a better idea?

-doodle
 
D

doodle

OK. I figured out what it is but I need help fixing it. It is the
..requery that is throwing it off.

What I need to requery: cmbContactName (Page two)

Why? Page two contains a datasheet that users can add new contacts to.
The datasheet also contains all of the contacts listed for that
customer previously. The cmbContactName field allows the user to select
which contact called in the order.

cmbContactName rowsource is qryCustomer:

SELECT ContactName
FROM tblCustContacts
WHERE CustNum = Forms!frmOrderEntry!CustNum;

I had the requery on afterupdate for cmbCustNum to update the combo box
if the user selects a different customer and I had the requery on the
timer to update the combo box if the user adds a new contact to the
listbox.

anyone have a better idea?

-doodle
 

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