F
forcefield via AccessMonster.com
Hi Everyone
My popup form, frmPop can update my main form, frmMain, but the table
remains unchanged ( or unrefreshed). How do you refresh the table?
Main table
tblMain
frmMain -- main form.
txtStandbyCash -- text field
txtPettyCash -- text field
frmPop -- popup form
cboXtraCash -- combo
cmdUpdate -- update button
cmdCancel -- Cancel button
While both frmMain and frmPop remain opened, clicking the update button on
frmPop will effect the following
1. txtStandbyCash to add to txtPettyCash
2. txtStandbyCash is being replaced by the value of cboXtraCash
3. frmPop closes leaving the main form, frmMain still opened.
Since frmMain draws its data from tblMain I expect the tblMain to be
refreshed,
but it did not. I have tried DoCmd.Requery in the update button but it does
not
work. How do I get the tblMain refreshed and where do I place such code?
The code for the update button:
Select Case MsgBox("Are you sure you want to add your yearly entitlement?", _
vbYesNo + vbExclaimation + vbSystemModal + vbDefaultButton1)
Case vbYes
[Forms]![frmMain].txtPettyCash = [Forms]![frmMain].
txtPettyCash +_
[Forms]![frmMain].txtStandbyCash
[Forms]![frmMain].txtStandbyCash = _
[Forms]![frmPop].cboXtraCash
Case vbNo
‘ Do nothing
End Select
DoCmd.Close acForm, "frmPop", acSaveYes
Thanks
My popup form, frmPop can update my main form, frmMain, but the table
remains unchanged ( or unrefreshed). How do you refresh the table?
Main table
tblMain
frmMain -- main form.
txtStandbyCash -- text field
txtPettyCash -- text field
frmPop -- popup form
cboXtraCash -- combo
cmdUpdate -- update button
cmdCancel -- Cancel button
While both frmMain and frmPop remain opened, clicking the update button on
frmPop will effect the following
1. txtStandbyCash to add to txtPettyCash
2. txtStandbyCash is being replaced by the value of cboXtraCash
3. frmPop closes leaving the main form, frmMain still opened.
Since frmMain draws its data from tblMain I expect the tblMain to be
refreshed,
but it did not. I have tried DoCmd.Requery in the update button but it does
not
work. How do I get the tblMain refreshed and where do I place such code?
The code for the update button:
Select Case MsgBox("Are you sure you want to add your yearly entitlement?", _
vbYesNo + vbExclaimation + vbSystemModal + vbDefaultButton1)
Case vbYes
[Forms]![frmMain].txtPettyCash = [Forms]![frmMain].
txtPettyCash +_
[Forms]![frmMain].txtStandbyCash
[Forms]![frmMain].txtStandbyCash = _
[Forms]![frmPop].cboXtraCash
Case vbNo
‘ Do nothing
End Select
DoCmd.Close acForm, "frmPop", acSaveYes
Thanks