Link to home
Start Free TrialLog in
Avatar of ShortellP
ShortellP

asked on

How do I enter and then propagate form field to its subform records (continuous form mode)

I have a form in which I want to be able to enter a PO# and then have that PO# Propagate into all records of a subform which is in continous form mode and is based on a query that has returned all the records that need the PO update.
I tried using the code example from an already posted response to another members question on how to do something like this.  The code offered was:
Private Sub Form_Current()
    If Me.NewRecord Then
        Me.txtState = Form_frmMainFormNameHere!txtState
    End If
End Sub
I changed Me.txtState to Me.strPO# and Form_frmMainFormNameHere'txtState to Form_frmEnterPO#"NewPO# but all I get is an error about Must be collection.
Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

You should run an update query to set the PO number.
It sounds like the query will start as the one you currently use to display the records.
Create a copy of that and then convert it to an update query.
You can the specify the Update to value for the PO field using a reference to your form

UpdateTo:  Forms!mainformname!POtextboxname
Avatar of ShortellP
ShortellP

ASKER

I think I understand and will try this out later today.
I will use the original querry to bring up the form and then have a command button that kicks off the Update Query once the PO# is filled in. If that is NOT what you mean. please let me know.
Thanks for the quick and easy to follow response.
ASKER CERTIFIED SOLUTION
Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Many thanks for pointing me to the right track on this.