Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update sub form!

Status
Not open for further replies.

nadir66

IS-IT--Management
May 30, 2002
34
0
0
Hi
I ahve a problem with a subform. The design:
Form1
cbo to choose item
Order button
Subform one option to order
subhform 2 show the order
all are conected through the cbo value.
click on order, pop-up shows with info, choose Qty and close. at this point the sub2 shoul be populated with data from the pop-up and sub1. It works 50% of the time, but then it does not. Strangely, the order is saved, but it does not show on screen.
Please help.
i am using in the pop-up requery of sub2.
nadir
(A97&A2k)
 
I think you may need to rephase your question, cant understand a word of this,
where are the queries?
what does the order button do?
what code is behind the button?

Give better examples of things working 50% of the time, is not working on certain values?
 
ok. sorry.
I have a form where i have 2 subforms. On th eform i have a combobox, with items. The same items decided what is visible on subform1. (process). On form 1 is a button that opens a pop-up (order) where some data is from subform1. Once the data is filled (address, name etc) on closing the popup it saves the data.
The same data should be then visible on subform2, conected through date and 2 variables. i havce the standard refresh method in work, but it still wworks only in 50% of cases.
i hope this is a better explanation.
nadir
 
"i havce the standard refresh method in work"

Does this mean you are using a VB command called me.refresh?
 
Hi,
My question also has to deal with the subform. I have a form(sales order) which includes a subform called line item. On my form I have a command button that is "add new record". The PK is a field called SalesOrderNum and it is a fk in my subform table. so when i update I want to force the SalesOrderNum to be the same in the sub field. Right now i can update but if i don't but the same Sales ordernumber save the information without the relationship, So there are two new entries in each table but not associated with each other.
Thank You
Jill

 
Sorry, i am using the requery method.

Private Sub Form_AfterUpdate()
Forms("tbl_process_order").Requery
End Sub

The data on the subform is acctually a querry that reads from 1 table.
 
Hi again

You could try using

me.refresh
or
me.requery

On the after update event.

try the requery one first.

Or you could add the code to your pop up form after the save record command has been called.

but you would need to reference it like:
forms!formname.requery

Hope this helps!

Nowell
 
thank you. i am trying that. my problem is also that my subform is called tbl_process_order subform. i always have the problem to present it properly. does it go like this:
(tbl_process_order subform) or ("tbl_process_order subform")
thx nadir
 
Hi,

Reference it like this [tbl_process_order subform]

Generally try to aviod using spaces in your names for objects, then you don't have to use square brackets.

Nowell
 
thank you. For some stupid reason i allowed access to do it.
thanx again.
nadir
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top