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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Continuous forms and Requery Troubles

Status
Not open for further replies.

BJNK

IS-IT--Management
Dec 12, 2006
52
0
0
CA
I have a form setup for the addition of materials that belong in a product, with product being the main form and ProductMaterial as the subform, which is continuous.

I have 6 combo boxes all dependent on the one in front of it. These are now working great (thank you people!) in the first record/row of the form.

But when I go to the second record/row to add another material to the product, as soon as I select a different Category (the first in the 6 combo boxes) it requeries all of the other boxes in the subform, not just the individual record/row.

The code I am using is from the FAQ section and looks like this:


Private Sub cboCategory_AfterUpdate()
cboType.Requery
cboDetail.Requery
cboDescription.Requery
cboWidth.Requery
cboLength.Requery
End Sub


Is there any way to have it only requery the specific record/row I am in or should I use some other sort of code?

Any help is appreciated! Please and thank you!
 
Seems that your combos aren't bound !

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Ok, what do you suggest I do to bound these combos? Im learning these thigns as I go, so your help is greatly appreciated.... and needed lol.
 
I changed the bound columns to the appropriate columns, but it still updates every row instead of just the row I am working in... Is it something else or did I do it incorrectley?
 
What are the ControlSource properties of the combos ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
The control source of each is the name of it.

so cboCategory's control source is simply Category, cboType is Type and so on and so forth...

Thank you for your help so far PHV
 
How are ya BJNK . . .

What your experiencing is the [blue]typical behavior of an unbound control in the detail section of a continuous form.[/blue]

For your puropose you may want to consider [blue]Data Entry mode[/blue] of the subform which suites what your trying to achieve. I see two command buttons . . . [purple]Show All[/purple] and [purple]Add New Record[/purple] (which sets data entry mode) . . .

[blue]Your Thoughts? . . .[/blue]

Calvin.gif
See Ya! . . . . . .
 
Hey Ace, well my thoughts are as follows: Number one I love Calvin and Hobbes and if you didnt already know GoComics.com has a daily Calvin and Hobbes strip :)

Secondly I really don't know what you mean by your suggestion. Are you saying make a button to bring up the table itself? I'm glad that you seem to know what I am talking about though, as most people I have approached seem to have no idea what Im talking about.
 
BJNK . . .

In form design view, put the cursor on the forms [blue]Data Entry[/blue] property line and hit F1 . . .

Calvin.gif
See Ya! . . . . . .
 
That does nothing to solve the problem.

I can add all of the materials on products we already have manually in the tables, that is fine.

But I'm trying to make this user friendly so if they have a new product down the road, all they have to do is open this form, name the new product, give its dimensions, and then select from the drop down combo boxes the materials that will go into it.

Setting it to Data entry does not change the problem.
The first box is Category, from that you select sheet stock, moldings, glass, hardware.
Second box is Type, where you select, Oak, Bronze etc.
Third is Detail 3/4 sheet, cut edge etc.
Fourth is Description, the actual name of the material.

Now if I select in the first record, Molding -> Oak -> 3/4 Sheet -> 3/4 Red Oak PBC.... it works.

As soon as I go to the second record and select a different category, Say Glass, it requiries everything, including the previous record.

Is there any way to fix this? Or any suggestions on how I can accomplish what I am trying to do through another method?

Thank you!
 
BJNK said:
[blue]That does nothing to solve the problem.[/blue]
Not that you see it yet! I'll try to explain best I can and under the circumstances the combo's are bound!

Lets say you have a number of records entered already (so far so good!) . . . the combo's for those records are able to display the selections!

Now in a new record your about to enter a secnario that doesn't exist for any previously saved records! What do you expect to show in previously saved records for a secnario that doesn't include any previously saved data/secnario! . . . this is your problem! Previously saved records no longer have that data available at the time of selection . . . its all new! . . . Do you see my point!

[blue]Your Thoughts? . . .[/blue]

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top