not populating fields already input

  • Thread starter rsbutterfly16 via AccessMonster.com
  • Start date
R

rsbutterfly16 via AccessMonster.com

hi guys, i was wondering if you can help me, i have a form in access the code
is kind of big but i am only having a problem when adding a new record so
here is that part .

the problem is that when someone enters an account code that needs to be
added then it refreshes the form, and the fields where the account code was
already entered is blank. (Account _Code). so i have to enter it again. and
also it does not record the data entered in the ComboA, combob and comboC
please see if you can help

Private Sub cmdNew_Record_Click()


.........


[Form_LOC Data Entry Form].Account_Code.SetFocus
'---------Account was not found, so it will be a new record.----------
----------

strSQL = "SELECT PM_Contract_ID FROM dbo_Contracts "
Me.combo_contractquery.RowSource = strSQL 'new record set

'---------Add the query to the control source of Contract --------
-
Set qdf = dbs.CreateQueryDef("qryLocateFEC", strSQL)

Me.cboStatus.Enabled = True
Me.combo_contractquery.Enabled = True
Me.ComboA.Enabled = True
Me.ComboB.Enabled = True
Me.ComboC.Enabled = True



DoCmd.GoToRecord , , acNewRec 'add new Account

End If


thank you in advance
 
S

SteveS

Being able to see only this small snippet of code,
try moving the DoCmd.GoToRecord to the line below the comment

'------------Account was not found, so it will be a new record.---------

DoCmd.GoToRecord , , acNewRec 'add new Account

strSQL = "SELECT PM_Contract_ID FROM dbo_Contracts "
Me.combo_contractquery.RowSource = strSQL 'new record set

__SNIP__


HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top