[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 679
  • Last Modified:

Running a query inside of open form

Hello experts!

OK here is what I am trying to accomplish:

I would like to have a form with an unbound drop down box that is selecting a date field off of my table.

No problem about that&

I would then like to take this field and have a second (sub) form become visible and update or refresh based on that selection in my main form using the afterupdate (or the what I have setup now is to click a button to run a query) on the field.

So when the user clicks and selects a date, the subform becomes visible and shows the field(s) I want the user to update.

What I have is a table that not all the fields are entered at time of data entry.  The user goes back to the table and updates later only after further information is received later.

Example is this:  The user puts hours into the boxes every day for 5 days&..closes and 5 days later the user goes back and puts a dollar amount that is spent on materials which then is used to calculate a total owed a customer for a final bill.

The user only needs to modify this 1 field in the table but only done at the end of the work when materials are added at the end of the work week.  I only want to have visible these 2 fields on the form.

I have my form setup&.I just need to know now how to take my query that runs outside of my form and make this visible and run inside my current open form&.
0
MilitaryDonut
Asked:
MilitaryDonut
  • 4
  • 3
  • 2
1 Solution
 
Rey Obrero (Capricorn1)Commented:
<What I have is a table that not all the fields are entered at time of data entry. >

do you already have a data entry form?
0
 
tbeernotCommented:
Let me rephrase your question to see if I understand it correctly: you want a new form to open after a date was entered. This form shows existing records (of the entered date) with one column editable where the materials spent can be entered. You have query that already shows the record, you only need a form. Correct?

As a first poke, how far do you get by:
1. generating a form using the wizard based on the existing query?
2. Add a docmd.openform... line in the  afterupdate of the date entry box?
0
 
MilitaryDonutAuthor Commented:
yes without this field....maybe reuse and get rid of the other fields not needed?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Rey Obrero (Capricorn1)Commented:
tbeernot, MilitaryDonut
i will leave you two on this...
0
 
MilitaryDonutAuthor Commented:
tbeernot:

Yes....but I would like the "query" to open inside my form without running outside the form...I click "run query" and instead of opening outside of form...how can I get it to open inside the current open form?


0
 
tbeernotCommented:
Not being 100% certain what you mean, but would a subform solve your problem? A subform is a form embedded into another. First you create a form based on the query and then drag that form on the existing one.
0
 
MilitaryDonutAuthor Commented:
Sure...I created the form from the query but can't seem to figure out how to get the form to open inside my current open form when I click my command button....is there a way to get the form to open inside my current open form?

My drop down boxes are all "unbound"
0
 
MilitaryDonutAuthor Commented:
Oh...I have dropped the "subform" inside the main form...
0
 
tbeernotCommented:
Yes. The subform has a name just like the normal controls. So you can reference it.

Say it is name "abc" , then abc.form.Filter will allow you to access the filter property of the subform. After setting that, you can abc.form.FilterOn = true
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

  • 4
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now