Full Version: Combo box question
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
hhh1027
I have form for product sales entry and there is control [Status] which is 1 to 4. Product for data entry has to be status 1 and when item is available for sale I have to change the status to 1 before data entry. How can i change the status while in the form for data entry. Right know I open the other form for the status change I then come back for the form for data entry, but also it does not get update unless I close the form first and open again. Please help.

Thanks
PropMgr
'Requery Sub-form
Form!sfmExpenseDetailEnter.Requery
hhh1027
there is no subform they are two different forms
PropMgr
Not a problem I was just being lazy and copied the code from mine to ensure that I did not get an error with my hunt and peck typing

Form!(Name of Form).Action

or in my case

'Requery Sub-form
Form!sfmExpenseDetailEnter.Requery

WHere sfmExpenseDetailEnter is the name of the form that I want to requery

Michael
dannyseager
Michael

I don't think your code to requery the sub form is correct.

to requery a subform you would either use

me.SubformControlName.requery (if you're calling the requery from the parent form)

or

forms!ParentFormName.SubformControlName.requery

You never need to refer to the name of the actual sub form

** SubformControlName = This is the control on the parent form that holds the sub form in it.

A great link for working out how to refer to various form's is : http://www.mvps.org/access/forms/frm0031.htm
hhh1027
I'm not sure if what I'm trying to do is right. Basically I have form for data entry and another form for product status, whil I'm in the data entry form I want to be able to change the status and at the same time get this information update in the data entry form.
PropMgr
I agree you are doing it correctly, I am doing exactly the same thing, and while it looks like my reference may be incorrect, it is functioning as intended. I wll look at the link posted by Danny and see if I need to change my code. It sounds like I will need to.

Danny - thank you for correcting me.

Michael
hhh1027
Where do the codes go?.

Thanks
PropMgr
Depends on how you are running your procedures,

On mine I have a comand button on the main form
which createse a record in the other table

Specifically I have a button on my expense form which when pressed creates an invoice. It then requeries the sub.form and then brings the invoice number to the sub form to create the link.

So in my case I have a command button on the main form to do several task on click.

I'm not quite sure of what you are tying to do.
Do you want to post a sample with your question???

Here is a link to a sample I posted by way of example
http://www.utteraccess.com/forums/showflat...1903377&Zp=
Michael
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.