Bookmark after Append Query

beckysright

New member
Local time
Today, 02:59
Joined
May 25, 2012
Messages
4
Hi everyone, I am really new to VBA programming and I need some help. I have created a Quote form that when you click a button it creates the quote number, date and makes a subform visible. Finally, it also does an append query so that the next quote number is based off of. My problem is that every time I click it, the form returns to the first record. I know that there is a way to bookmark this but I can't seem to figure out how to do it. I would appreciate your help but since I am new, please be patient with me. Thank you!

Private Sub CreateQuoteNo_Click()


Me.QuoteNo = Format(Date, "yyyy") & "-" & Nz(DMax("Quotes", "PastQuotes"), 0) + 1
Me.QuoteNo.Visible = True
Me.QuoteDate.Visible = True
Me.btnPrintQuote.Visible = True
Me.btnEmailQuote.Visible = True
Me.CreateInvoice.Visible = True
Me.QuoteFrame.Visible = True
QuoteDate = Date
Me.QuoteServicesSF.Visible = True
Me.QuoteTotals.Visible = True
Me.btnMakeContract.Visible = True
DoCmd.Save

On Error GoTo Copy_Of_macAppendQuoteNo_Err

DoCmd.SetWarnings False
DoCmd.OpenQuery "qryAppendQuoteNo", acViewNormal, acEdit
DoCmd.SetFilter "", "[QuoteNo]", ""
DoCmd.Close acQuery, "qryAppendQuoteNo"
DoCmd.SetWarnings True


Copy_Of_macAppendQuoteNo_Err:
MsgBox Error$


End Sub

Thank you!
 

Users who are viewing this thread

Back
Top Bottom