can't get out of dataentry mode

odrap

Registered User.
Local time
Today, 19:12
Joined
Dec 16, 2008
Messages
156
In a form to manage clients i have a button CmdNew to enter a new client. I have no button to save the new record, because it seems that Acces makes that possible without any other intervence. After entering the new record, when i want to go to the first or another record by means of the navigation buttons, i get an error message; it seems that the form is still in the dataentry mode. How can i solve that problem
 
you could say
Me.DataEntry = False

but what is the error msg? it could be unrelated to dataentry mode (maybe).

how did you get into data entry mode? if your command button to go to a new record is setting dataentry mode to true, you could remove it there.
 
As Wazz said, if you want to enter new records and view existing records, the form's Data Entry Property should be set to No. Data Entry set to Yes means you can only enter new records; you cannot also view old records.

What is the code behind cmdNew?
 
that's the code behind the event of the CmdNew button:

Private Sub CmdNieuw_Click()
On Error GoTo ErrorHandler
Bladwijzer = Me.Bookmark
DoCmd.GoToRecord Record:=acNewRec
Call LockControls(False)
Me!cboAgent.SetFocus
Me!cboZoekViaKlntNr.Locked = True 'Bij invoeren van nieuwe record niet nodig
Me!cboZoekViaKlntNaam.Locked = True 'idem
Me!cboZoekViaBedrijfsNaam.Locked = True 'idem
Me!CmdVorige.Enabled = Not (Me.NewRecord)
Me!Cmdeerste.Enabled = Not (Me.NewRecord)
Me!CmdLaatste.Enabled = Not (Me.NewRecord)
Me!CmdVolgende.Enabled = Not (Me.NewRecord)
Me!CmdWijzigen.Enabled = Not (Me.NewRecord)
Me!CmdNieuw.Enabled = Not (Me.NewRecord)
Afsluiten:
On Error GoTo 0
Exit Sub
ErrorHandler:
mededeling = foutbericht("CmdNieuw_Click", "frmKlanten", Err.Number)
Resume Afsluiten
End Sub
 
hard to tell. the trouble might be in
Call LockControls(False).

perhaps this needs to be called again when you move off the new record? seems that False would be OK though, from the looks of it.
 

Users who are viewing this thread

Back
Top Bottom