subform refresh/requery problem

S

Silvio

I have a main form (frmCharges) with subform1 (frmChargeAddSub) and subform2
(frmBankSub).

Subform1 is used to enter new record and subform2 is used to show all the
record including the one recently entered using subform1.

The problem:
In some computer the records do show in subform2 as soon it has been entered
from subfom1 and in some other computer you need to close the mainform and
re-open it in order to see the recently entered record. That tells me that
the data is not being refreshed/requeried/recalc or whatever.

This is my code of my command button:
Forms![frmCharge]![frmBankSub].Requery

Should this line read differently?
Also, should I really use requery, refresh or Recal, or all?

Thanks you for the advice.
Silvio
 
M

Marshall Barton

Silvio said:
I have a main form (frmCharges) with subform1 (frmChargeAddSub) and subform2
(frmBankSub).

Subform1 is used to enter new record and subform2 is used to show all the
record including the one recently entered using subform1.

The problem:
In some computer the records do show in subform2 as soon it has been entered
from subfom1 and in some other computer you need to close the mainform and
re-open it in order to see the recently entered record. That tells me that
the data is not being refreshed/requeried/recalc or whatever.

This is my code of my command button:
Forms![frmCharge]![frmBankSub].Requery

Should this line read differently?


Requery is the thing to use.

Your syntax would work in A2K or earlier, but the .Form
property is now required:
Forms!frmCharge!frmBankSub.Form.Requery
 
S

Silvio

Thank you so much!

Marshall Barton said:
Silvio said:
I have a main form (frmCharges) with subform1 (frmChargeAddSub) and subform2
(frmBankSub).

Subform1 is used to enter new record and subform2 is used to show all the
record including the one recently entered using subform1.

The problem:
In some computer the records do show in subform2 as soon it has been entered
from subfom1 and in some other computer you need to close the mainform and
re-open it in order to see the recently entered record. That tells me that
the data is not being refreshed/requeried/recalc or whatever.

This is my code of my command button:
Forms![frmCharge]![frmBankSub].Requery

Should this line read differently?


Requery is the thing to use.

Your syntax would work in A2K or earlier, but the .Form
property is now required:
Forms!frmCharge!frmBankSub.Form.Requery
 
S

Silvio

Mmmmhhh still having the same problem. I am using
Forms!frmCharge!frmBankSub.Form.Requery

If makes any difference, frmBankSub is in a Tab Control. The subform was
added by using the subform import control from the toolbox. frmBankSub
control source is qryBankSub. In my Pc seems to work fine however when I
installed the software in one of the users in one occasion did not
requery/refresh. I entered several other records and I had no problem. It is
had to troubleshooting when a problem is inconsistent.

Any other suggestion?



Marshall Barton said:
Silvio said:
I have a main form (frmCharges) with subform1 (frmChargeAddSub) and subform2
(frmBankSub).

Subform1 is used to enter new record and subform2 is used to show all the
record including the one recently entered using subform1.

The problem:
In some computer the records do show in subform2 as soon it has been entered
from subfom1 and in some other computer you need to close the mainform and
re-open it in order to see the recently entered record. That tells me that
the data is not being refreshed/requeried/recalc or whatever.

This is my code of my command button:
Forms![frmCharge]![frmBankSub].Requery

Should this line read differently?


Requery is the thing to use.

Your syntax would work in A2K or earlier, but the .Form
property is now required:
Forms!frmCharge!frmBankSub.Form.Requery
 
S

Silvio

By the way, in my office we all use Access 2003.

Marshall Barton said:
Silvio said:
I have a main form (frmCharges) with subform1 (frmChargeAddSub) and subform2
(frmBankSub).

Subform1 is used to enter new record and subform2 is used to show all the
record including the one recently entered using subform1.

The problem:
In some computer the records do show in subform2 as soon it has been entered
from subfom1 and in some other computer you need to close the mainform and
re-open it in order to see the recently entered record. That tells me that
the data is not being refreshed/requeried/recalc or whatever.

This is my code of my command button:
Forms![frmCharge]![frmBankSub].Requery

Should this line read differently?


Requery is the thing to use.

Your syntax would work in A2K or earlier, but the .Form
property is now required:
Forms!frmCharge!frmBankSub.Form.Requery
 
M

Marshall Barton

Silvio said:
Mmmmhhh still having the same problem. I am using
Forms!frmCharge!frmBankSub.Form.Requery

If makes any difference, frmBankSub is in a Tab Control. The subform was
added by using the subform import control from the toolbox. frmBankSub
control source is qryBankSub. In my Pc seems to work fine however when I
installed the software in one of the users in one occasion did not
requery/refresh. I entered several other records and I had no problem. It is
had to troubleshooting when a problem is inconsistent.


The Tab control is not relevant to this issue.

I have never use a query as a subform control's
SourceObject, so, while I don't expect there are, I don't
know if there are any issues with that arrangement.

Maybe you meant that the frmBankSub subform control's
SourceObject is the frmBankSub form object and that the
frmBankSub form's RecordSource is qryBankSub.

Since you said frmBankSub is not sunchronized to the current
record in frmChargeAddSub, make sure that the frmBankSub
subform control's Link Master/Child properties are empty.

The only other thing I can think of is that the Requery is
taking a long time to complete. If this is what's causing
the problem, try adding another line of code right after the
Requery line:

Forms!frmCharge!frmBankSub.Form.RecordsetClone.MoveLast
 
S

Silvio

The sequence is this: The user opens up the main form. The main form has a
combo box that that will retrieve a specific project number from the list.
Once the project number is retrieved, the TAB control become visible and the
user can click among other options, on enter new record TAB to enter a new
record or Time Bank TAB to see existing record. However, the records are
related to the existing project number by project number and cycle number (2
relations) since one project can have more than one cycle. So if the current
cycle is 3, then only records with cycle 3 will show. The form frmBankSub is
a subform lonked to a query sqyBankSub.
 
M

Marshall Barton

I think that means that both subform control's LinkMaster is
set to the project number combo box and something somewhere
with the cycle number and the LinkChild is set to the the
project number and cycle number fields.

Did you try using the MoveLast that I suggested?
 
S

Silvio

Yes I have. I am working from home today and I will test it on Monday in
office. As usual, in my PC runs perfectly, however, when I install the same
software in 10 other PCs I will discover 10 new problems :)

Thanks!

Marshall Barton said:
I think that means that both subform control's LinkMaster is
set to the project number combo box and something somewhere
with the cycle number and the LinkChild is set to the the
project number and cycle number fields.

Did you try using the MoveLast that I suggested?
--
Marsh
MVP [MS Access]

The sequence is this: The user opens up the main form. The main form has a
combo box that that will retrieve a specific project number from the list.
Once the project number is retrieved, the TAB control become visible and the
user can click among other options, on enter new record TAB to enter a new
record or Time Bank TAB to see existing record. However, the records are
related to the existing project number by project number and cycle number (2
relations) since one project can have more than one cycle. So if the current
cycle is 3, then only records with cycle 3 will show. The form frmBankSub is
a subform lonked to a query sqyBankSub.
 

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