Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    New England (Connecticut)
    Posts
    200
    Thanks
    1
    Thanked 0 Times in 0 Posts

    saving records on form (office 03)

    Hi all,
    This is a wordy question so I hope to make it simple. I have a parent form/sub form set up where the sub form is based on a simple select query filtered by a value in a textbox field on the parent form. The sub form opens in a continous form view format. I have attached a zip of the screen shot to make it visually easier to understand. After the initial records display, (Left hand part of screen shot), I am using a second subform to further sort records and make changes to the data on the record (Right hand part of screen shot). The right hand subform uses a second select query by changing the record source so that the filtering can take place. I am using the following code:

    Forms![Pricing]![pricing detail tarcuts].Form.RecordSource = "qryPricing DetailTarCuts"

    Forms![Pricing]![pricing detail tarcuts].Form.Requery ...

    My problem is that once further filtered, I cannot add a record to the recordset. It will show on the left hand subform but as soon as I tab from on tab to another it goes away. When I look at the table data I also do not see the record.

    Can someone point me in a direction to look as I am at a loss as to why this is happening.

    Thanks
    Kevin
    Attached Files Attached Files
    Kevin

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: saving records on form (office 03)

    In the first place, you're setting the RecordSource of the subform to the same query all the time, so there is no need to use the line

    ...RecordSource = "qryPricing DetailTarCuts"

    The line that requeries the subform might still be required.

    Apart from that:
    1) Is the second subform linked to the main form and if so, how?
    2) Can you tell us more about the query "qryPricing DetailTarCuts"?

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    New England (Connecticut)
    Posts
    200
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: saving records on form (office 03)

    Thanks Hans,

    I'm not sure if I was clear at first. When the form initially opens the record source is set to a different query. The second subform is used when a user wants to slice and dice the record set in different ways. So I change the record source to handle the different ways the records can be displayed. It is triggered in the on change event for the Option "Tar Type Cuts" which is located on the second form on the right. It may be used once or more than once as the user slices and dices the record set view. "qryPricing DetailTarCuts" is a select query based on a table where the underlying records reside and it consists of specific criteria relating to combo boxes on the second form to filter the records. The second form by the way is not tied to the parent. I have attached a screen shot of part of the query so you can see the criteria if it helps (the sql is a mile long).

    Not sure if I am answering your question(s)

    Thanks
    Kevin
    Attached Files Attached Files
    Kevin

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: saving records on form (office 03)

    I don't think I can help without seeing the database. Could you post a stripped down copy of your database? See <post#=401925>post 401925</post#> for instructions.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •