Driving input from one form to update another

It's either you change the AirOpsForm to a Single Form that's set as a dialog form

Or do the following:

1. The textbox needs to be bound to a field
2. When you set the value from AirOpsForm you need to check:
a. is the current ID on AirOpsForm = the current ID of Aircraft form. If it is update the textbox's value
b. otherwise, run an UPDATE query
3. Requery Aircraft form to reflect changes.
 
vbaNet,

Sorry not to get back to you earlier. I have been busy the last couple days. Here is what I came up with. Two different ways of doing it in the attachment.

Note the AirOpsForm on the Example attachment from previous...I added the code below and when Fifteen is checked it will ask for a parameter, if you type in the Side (100 Bounty) the FifteenQuery (Update Query) will run and it did what I wanted for a limited time...for some reason it has stopped?? However, I do not want to pimp the user for the parameter since it is already in the AirOpsForm.

After extensive research...and pounding my head against the wall for the last 6 hours I tried different code in the Airborne AfterUpdate in attempt to auto fill the parameter. Unfortunately I am not able to make it work. What am I missing here?

Respectfully and very thankful for your help,
la1814

Code:
Private Sub Airborne_AfterUpdate()
 
Dim qdf As DAO.QueryDef
Dim prmOne As DAO.Parameter
Dim rst As Recordset
 
     'open query
    Set qdf = db.QueryDefs("AirborneQuery")
     'link Parameters to the query
    Set prmOne = qdf.Parameters!param_one
     'set the values of the parameters
    prmOne = Me.Form!AirOpsForm!Side
     Set rst = qdf.OpenRecordset(dbOpenDynaset, dbSeeChanges)
     Set rst = Nothing
    Set prmOne = Nothing
    Set qdf = Nothing
    
    End Sub
 
 Private Sub Fifteen_AfterUpdate()

  If Fifteen Then
     DoCmd.SetWarnings False
    DoCmd.OpenQuery "FifteenQuery"
    DoCmd.SetWarnings True
     Else
    End If
 
 End Sub
 
vbaINet,

I think I have solved it! I decided to use my original AirOpsPlanForm and add the 'Flight Status' Field from the AircraftForm since they have a relationship. I then wrote an event to update the Flight Status when Airborne/Fifteen/OnDeck is checked. I will then Requery the AircraftForm thus updating the conditional formatting to reflect the color I wanted. This seems much simpler...wish I would have gone this route before. Can't buy those lost hours back.

Again, thanks for your help and have a good weekend. Let me know if you see any issues with this route knowing the forms will both be open by different users.

Thanks,
la1814
 
If you were going to do this in the first place then there was no point having two separate forms.

Both would have been subforms on the same form because they are in datasheet view.
 
I started with two separate forms because they have much more info that what I am presenting here and will be viewed by different parties that only need certain data. So I built the forms separately then realized I needed to do what you have been helping me with. I will still keep two forms for viewing the info, however will incorporate the FlightStatus in the one to enable what I want to do here. This came to play after and created this headache being the newbie I am. Thanks again for the help.
 
Well I hope you're now using one field for the status as opposed to three.
 

Users who are viewing this thread

Back
Top Bottom