View Single Post
  #1  
Old May 10th, 2010, 03:01 PM posted to microsoft.public.access.forms
PHisaw
external usenet poster
 
Posts: 224
Default Quote Form With Options - Repost


It seems my original thread of 4/29/10 "Quote Form with Options" has been
forgotten. Tom van Stiphout was helping and gave me the instructions for a
button to ""Create New
Option". It would look at the maximum option used so far (DMax
function) and add 1 to it.
When the button is clicked, you save the JobNumber information and
perhaps some other key information, go to a new record, populate the
JobNumber with the saved value, and set the Option field to whatever
DMax(...)+1 returns."

I have researched and tried several methods of code, but can't seem to get
anything to work other than the option field increasing in number. This is
currently what I have which throws an error message "can't go to specified
record" and highlights the GoToRecord,,acNewRec line. I think it has
something to do with the job number, but can't figure out how to correct it.

Private Sub LblQuoteOptions_Click()

DoCmd.RunCommand acCmdSave
DoCmd.GoToRecord , , acNewRec
Me.JobNumber.DefaultValue = """" & Me.JobNumber.Value & """"
Me.Option = Nz(DMax("Option", "tquotemainform"), 0) + 1

End Sub


Any suggestions would be greatly appreciated.
Thank in advance,
Pam