How can I do the following in Access?

  • Thread starter Thread starter KK
  • Start date Start date
K

KK

Hi guys

I am new to access and trying to get the following done.
If anybody can help me I would appreciate

1) I have a databound access form.
It by default open in data add mode.

When it starts up in the onload event
I fill one of the field for user (an ID field)

However, if user wishes to cancel and close
the form, I have given a Close button. But when
user closes the form Access shows its own
message saying

"you can't save this record at this time etc...."

how can I avoid this message box and just close
the window?

2) I want to have my own buttons to do
Add New Record
Update Record
Delete Record

but if i try to do a
Me.RecordSource.AddNew
or
Me.RecordSource.Update
in a databound form it doesn't work.

regards
KK
 
Hi,
When it starts up in the onload event
I fill one of the field for user (an ID field)

However, if user wishes to cancel and close
the form, I have given a Close button. But when
user closes the form Access shows its own
message saying
"you can't save this record at this time etc...."
how can I avoid this message box and just close
the window?
This is happening because you have started to add a new record by adding the
ID, have a look at populating the defaultvalue of the control instead, and
the record probably can't be saved because the primary key is not populated.
2) I want to have my own buttons to do
Add New Record
DoCmd.GoToRecord , , acNewRec
Update Record
DoCmd.RunCommand acCmdSaveRecord
Delete Record
DoCmd.RunCommand acCmdDeleteRecord
 
Back
Top