W
warrior
I have a number of text boxes on a main form that are populated on the
cmbDate "On Change" event. When the user select "cmdNEW", another form
is loaded for a new check date.
Problem: The main form will not requery unless I click into the
cmbDate. I've tried several of the events on the main form and on the
new date form. I've also tried setting the focus on the cmbDate when I
close the new date form.
Any suggestions would be appreciated. Thanks
Dim SQL1 As String
SQL1 = "SELECT tLimits.FiscalYear, tLimits.FYBegDate,
tLimits.FYEndDate, " & _
"tLimits.BaseVested, tLimits.BaseNonVested,
tLimits.FICALimit, tLimits.VestedExcessFICA, " & _
"tLimits.MaxERContribution, tLimits.MaxEEVoluntary,
tLimits.MaxCatchUpOver50 " & _
"FROM tLimits " & _
"WHERE tLimits.FYBegDate <= #" &
[Forms]![fdataentry]![cmbCheckDate] & _
"# AND tLimits.FYEndDate >= #" &
[Forms]![fdataentry]![cmbCheckDate] & "#"
Dim db As DAO.Database
Dim rec As DAO.Recordset
Set db = CurrentDb()
Set rec = db.OpenRecordset(SQL1)
If rec.EOF = True Then
MsgBox "There is no fiscal year."
End If
With rec
.MoveFirst
Forms![fdataentry]![txtFiscalYear] = ![FiscalYear]
Me.txtFYBegDate = ![fybegdate]
Me.txtFYEndDate = ![fyenddate]
Me.txtBaseVested = ![basevested]
Me.txtBaseNonVested = ![basenonvested]
Me.txtFICALimit = ![ficalimit]
Me.txtExcessFICALimit = ![vestedexcessfica]
Me.txtMaxERContrib = ![MaxERContribution]
Me.txtMaxEEVoluntary = ![maxeevoluntary]
Me.txtMaxCatchUp = ![maxcatchupover50]
End With
Call dhFirstDayInYear
Forms![fdataentry]![txtYTDGrossPay] = 0
Forms![fdataentry]![txtEE401k] = 0
Forms![fdataentry]![txtEE401kCatchUp] = 0
Forms![fdataentry]![txtEERoth] = 0
Forms![fdataentry]![txtEERothCatchUp] = 0
Forms![fdataentry]![txtFTDGrossPay] = 0
Forms![fdataentry]![txtFTDEE401k] = 0
Forms![fdataentry]![txtFTDEE401kCatchup] = 0
Forms![fdataentry]![txtFTDEERoth] = 0
Forms![fdataentry]![txtFTDEERothCatchup] = 0
Forms![fdataentry]![txtAge].Requery
Forms![fdataentry]![txtBDate].Requery
Forms![fdataentry]![txtEmpID].Requery
Forms![fdataentry].[fdataentry subform].Form.Requery
Forms![fdataentry]![txtYear].Requery
end sub
cmbDate "On Change" event. When the user select "cmdNEW", another form
is loaded for a new check date.
Problem: The main form will not requery unless I click into the
cmbDate. I've tried several of the events on the main form and on the
new date form. I've also tried setting the focus on the cmbDate when I
close the new date form.
Any suggestions would be appreciated. Thanks
Dim SQL1 As String
SQL1 = "SELECT tLimits.FiscalYear, tLimits.FYBegDate,
tLimits.FYEndDate, " & _
"tLimits.BaseVested, tLimits.BaseNonVested,
tLimits.FICALimit, tLimits.VestedExcessFICA, " & _
"tLimits.MaxERContribution, tLimits.MaxEEVoluntary,
tLimits.MaxCatchUpOver50 " & _
"FROM tLimits " & _
"WHERE tLimits.FYBegDate <= #" &
[Forms]![fdataentry]![cmbCheckDate] & _
"# AND tLimits.FYEndDate >= #" &
[Forms]![fdataentry]![cmbCheckDate] & "#"
Dim db As DAO.Database
Dim rec As DAO.Recordset
Set db = CurrentDb()
Set rec = db.OpenRecordset(SQL1)
If rec.EOF = True Then
MsgBox "There is no fiscal year."
End If
With rec
.MoveFirst
Forms![fdataentry]![txtFiscalYear] = ![FiscalYear]
Me.txtFYBegDate = ![fybegdate]
Me.txtFYEndDate = ![fyenddate]
Me.txtBaseVested = ![basevested]
Me.txtBaseNonVested = ![basenonvested]
Me.txtFICALimit = ![ficalimit]
Me.txtExcessFICALimit = ![vestedexcessfica]
Me.txtMaxERContrib = ![MaxERContribution]
Me.txtMaxEEVoluntary = ![maxeevoluntary]
Me.txtMaxCatchUp = ![maxcatchupover50]
End With
Call dhFirstDayInYear
Forms![fdataentry]![txtYTDGrossPay] = 0
Forms![fdataentry]![txtEE401k] = 0
Forms![fdataentry]![txtEE401kCatchUp] = 0
Forms![fdataentry]![txtEERoth] = 0
Forms![fdataentry]![txtEERothCatchUp] = 0
Forms![fdataentry]![txtFTDGrossPay] = 0
Forms![fdataentry]![txtFTDEE401k] = 0
Forms![fdataentry]![txtFTDEE401kCatchup] = 0
Forms![fdataentry]![txtFTDEERoth] = 0
Forms![fdataentry]![txtFTDEERothCatchup] = 0
Forms![fdataentry]![txtAge].Requery
Forms![fdataentry]![txtBDate].Requery
Forms![fdataentry]![txtEmpID].Requery
Forms![fdataentry].[fdataentry subform].Form.Requery
Forms![fdataentry]![txtYear].Requery
end sub