• saving records on form (office 03)

    Author
    Topic
    #445768

    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

    Viewing 0 reply threads
    Author
    Replies
    • #1081754

      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”?

      • #1081800

        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

        • #1081805

          I don’t think I can help without seeing the database. Could you post a stripped down copy of your database? See post 401925 for instructions.

    Viewing 0 reply threads
    Reply To: saving records on form (office 03)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: