NewTexican
Technical User
Ok, this one is driving me super nuts.
I have 2 pop ups. One pop is all plans. Other pop up is plans with a certain company. User selects plan from one pop up hits a command button and the plan shows up on the other pop up under the company name. I've done this before and not had any problems. Here is the deal: I pick a plan and my requery doesn't happen on the company pop up. I pick a second plan and my requery puts the first and the second plan on the company pop up together. It's like every other plan gets requeried. I've tried refresh, time delay and requery.
Private Sub Command29_Click()
On Error GoTo Err_Command29_Click
Dim ddb As Database
Dim rrs As DAO.Recordset
Dim pln1 As Long
Dim pln2 As String
Dim ccn As Long
Dim stdocname5 As String
Set ddb = DBEngine.Workspaces(0).OpenDatabase("...plan module I")
Set rrs = ddb.OpenRecordset("plan-company T", dbOpenDynaset)
pln1 = Me![plan numeric]
pln2 = Me![plan alpha]
ccn = Forms![common company].[Company Numeric]
stdocname5 = "plan f"
With rrs
.AddNew
![plan numeric] = pln1
![plan alpha] = pln2
![Company Numeric] = ccn
.Update
End With
rrs.Close
Set ddb = Nothing
Set rrs = Nothing
DoCmd.Save
Me.TimerInterval = 10000
DoCmd.Hourglass True
Forms![plan-company pop up].SetFocus
Forms![plan-company pop up].Requery
Forms![plan-company pop up].Refresh
DoCmd.Close acForm, stdocname5
DoCmd.Hourglass False
Exit_Command29_Click:
Exit Sub
Err_Command29_Click:
MsgBox Err.Description
Resume Exit_Command29_Click
I have 2 pop ups. One pop is all plans. Other pop up is plans with a certain company. User selects plan from one pop up hits a command button and the plan shows up on the other pop up under the company name. I've done this before and not had any problems. Here is the deal: I pick a plan and my requery doesn't happen on the company pop up. I pick a second plan and my requery puts the first and the second plan on the company pop up together. It's like every other plan gets requeried. I've tried refresh, time delay and requery.
Private Sub Command29_Click()
On Error GoTo Err_Command29_Click
Dim ddb As Database
Dim rrs As DAO.Recordset
Dim pln1 As Long
Dim pln2 As String
Dim ccn As Long
Dim stdocname5 As String
Set ddb = DBEngine.Workspaces(0).OpenDatabase("...plan module I")
Set rrs = ddb.OpenRecordset("plan-company T", dbOpenDynaset)
pln1 = Me![plan numeric]
pln2 = Me![plan alpha]
ccn = Forms![common company].[Company Numeric]
stdocname5 = "plan f"
With rrs
.AddNew
![plan numeric] = pln1
![plan alpha] = pln2
![Company Numeric] = ccn
.Update
End With
rrs.Close
Set ddb = Nothing
Set rrs = Nothing
DoCmd.Save
Me.TimerInterval = 10000
DoCmd.Hourglass True
Forms![plan-company pop up].SetFocus
Forms![plan-company pop up].Requery
Forms![plan-company pop up].Refresh
DoCmd.Close acForm, stdocname5
DoCmd.Hourglass False
Exit_Command29_Click:
Exit Sub
Err_Command29_Click:
MsgBox Err.Description
Resume Exit_Command29_Click