T
tgavin
I have an tabular form with check boxes that need to be changed but the form
is not updatable. I wrote some code that seems to work but the form needs to
be requeried to show that it has been updated. The only code I can get to
work with this requeries the entire list which causes the user to lose his
place. The code I am using is:
Dim SQL As String
DoCmd.SetWarnings False
If Me!booHolidayCard.Value = -1 Then
SQL = "Update [tblClients-Peach]" & _
"Set [tblClients-Peach].booHolidayCard = 0 " & _
"WHERE [tblClients-Peach].CustID =
[Forms]![frmGiftSelection]![CustID]"
DoCmd.RunSQL SQL
DoCmd.Requery
ElseIf Me!booHolidayCard.Value = 0 Then
SQL = "Update [tblClients-Peach]" & _
"Set [tblClients-Peach].booHolidayCard = -1 " & _
"WHERE [tblClients-Peach].CustID =
[Forms]![frmGiftSelection]![CustID]"
DoCmd.RunSQL SQL
DoCmd.Requery
End If
How can I write it so that it only requeries the specific record in the form?
Thanks!
Terri
is not updatable. I wrote some code that seems to work but the form needs to
be requeried to show that it has been updated. The only code I can get to
work with this requeries the entire list which causes the user to lose his
place. The code I am using is:
Dim SQL As String
DoCmd.SetWarnings False
If Me!booHolidayCard.Value = -1 Then
SQL = "Update [tblClients-Peach]" & _
"Set [tblClients-Peach].booHolidayCard = 0 " & _
"WHERE [tblClients-Peach].CustID =
[Forms]![frmGiftSelection]![CustID]"
DoCmd.RunSQL SQL
DoCmd.Requery
ElseIf Me!booHolidayCard.Value = 0 Then
SQL = "Update [tblClients-Peach]" & _
"Set [tblClients-Peach].booHolidayCard = -1 " & _
"WHERE [tblClients-Peach].CustID =
[Forms]![frmGiftSelection]![CustID]"
DoCmd.RunSQL SQL
DoCmd.Requery
End If
How can I write it so that it only requeries the specific record in the form?
Thanks!
Terri