I've made a button on a form which, when pressed, adds 1 to one field and adds 7 to another. The problem I am having is selecting which record this applies to. I am wanting for the button to apply to the record on display in the form. ...
I've made a button on a form which, when pressed, adds 1 to one field and adds 7 to another.
The problem I am having is selecting which record this applies to.
I am wanting for the button to apply to the record on display in the form.
I've been able to get the number of the current record into a variable lngrecordnum but am unsure how I can use this to select the record I want to edit
Any help is much appreciated. My code is below:
Sub CallMade()
Dim dbs As DAO.Database
Dim rstQuotes As DAO.Recordset
Dim lngrecordnum As Long
Set dbs = CurrentDb
Set rstCustomerQuotes = dbs.OpenRecordset("Quotes Table")
lngrecordnum = Forms![Quotes Table Form].CurrentRecord
'Select which record here
rstQuotes.Edit
rstQuotes!Call_attempt = rstQuotes!Call_attempt + 1
rstQuotes!Priority = rstQuotes!Priority + 7
rstQuotes.Update
End Sub