looping thru a continous form

J

JohnE

I have a situation in which in the header of the continous form has 2 fields
that list the warranty length (standard and max). In the continous form
there are 2 fields of the same nature that feed off warranty fields (standard
by line and max by line). But, the products in the continuous form will and
will not have the same warranty. As new product is added (and can be more
then one at a time) the line item should self populate from the warranty
fields in the header. Now, a new contract (same product) is done has new
warranty lengths. The product lead comes into the form and changes the
warranty lengths to the new contract. For any new product that shows on the
form should then be populated with the new warranty lengths. The already
existing line items should not be affected by the new warranty lengths.

My first attempt was use an isnull type but that only worked on one line
item. My next was to do a loop for the new line items (have no warranty
length listed) and populate with the new warranty length. It is the looping
that I am having difficulty with and ask for help on it. I suspect this
would be in the form open (or load) event so it is done when the user views
the information. Can someone help with the loop?

Thanks...John
 
J

Jeff Boyce

John

It sounds as though you think of the underlying data as "in" the form. It
isn't. In Access, forms DISPLAY data, but tables store it.

Consider using a query to retrieve all the data, then modifying that query
to get the specific conditions you are after.

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
J

JohnE

Jeff Boyce said:
John

It sounds as though you think of the underlying data as "in" the form. It
isn't. In Access, forms DISPLAY data, but tables store it.

Consider using a query to retrieve all the data, then modifying that query
to get the specific conditions you are after.

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.




.

I am aware of the difference but it is when the data is already displayed on
the form is when the warranty information is filled in. This entire db
structure predates me so I'm actually modifying an existing form that uses
sql2005 as the back end. So when the form opens (or loads) is when the
warranty information is completed. And depending on the part, one could be
added or a 100 could be added to the list, depends on part being manufactured
and shipped. But either way, warranty info is not added until the line item
makes the list.
 
J

Jeff Boyce

"Added ..." to what? If it only goes into the form, it isn't saved.

I was attempting to point out that the data in the form had to come from
somewhere, so why not work with the data, rather than the form?

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
J

JohnE

Just working it the way they all wanted it. If they do not enter the
warranty length into the 2 textboxes in the header, then neither the
appropriate standard or max length fields in the continous form get filled
in. What is entered into the 2 form fields in the header is what drives what
gets entered in the 2 columns of the continous form that are new line items
that do not have any warranty established yet, so those are empty fields.

The users here have been using the same Access db look and feel since A97
came out. The front end has grown to 35mgs that is connected to 6gig sql
server db. The users don't care about the what, where, how, or why. Just
the who is doing it and when will it be ready.
John
 
J

Jeff Boyce

What the users see in their interface and what you, as the developer does
behind the curtain do not have to be the same.

Some might argue (OK, I would argue <g>) that the developer's job is to HIDE
the complexity and give the users a tool that helps them get their job done.

The questions I posed reflect my philosophy...

Perhaps another reader can offer a "tell me which button to push"
solution...

Good luck!

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 

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