Save/Record/Delete buttons on a subform

Kubalism

Registered User.
Local time
Today, 13:46
Joined
Jul 4, 2012
Messages
36
Hello everyone,

How can i create the above stated buttons on subform?

I have one form which all 3 subforms are incorporated, the problem is the conventional buttons aren't working.

Can someone help me with this?
 
the problem is the conventional buttons aren't working.
Can you explain what the problems is. What are you doing.

Also there is no conventional Save. Save is automatic when you move away from the record.
 
Can you explain what the problems is. What are you doing.

Also there is no conventional Save. Save is automatic when you move away from the record.

Ok,

I have a form, within the form i have 3 subforms, which are Employee Involved, Immediate Superior Information and Witness information.

What the problem is when I click the save button it doesnt save it, same as when I click add a new record button nothing is happening.

Please see screenshot
 

Attachments

  • prob.JPG
    prob.JPG
    32.5 KB · Views: 297
I still can't see these buttons.

Try adding the Navigation Buttons from the Properties Box.
This will allow you to move to a new record. If you move you automatically save at the same time.

Moving from One Tab to another will also Save.

I assume you are using bound Forms.
 
Just as a matter of interest.

If CompanyID is Autonumber then it it is not normal to display this.

Some people use the saying, Primary Keys are not fit for user consumption.
 
Just as a matter of interest.

If CompanyID is Autonumber then it it is not normal to display this.

Some people use the saying, Primary Keys are not fit for user consumption.

The CompanyID is not an autonumber. It is there so that I can input a unique DXXXX format for each employee.

Adding the navigation button will save. But is there no way of adding a single button which will save all entries from the 3subforms at the same time?
 
The only Record that is not Saved is the Record that you are on.

As I said earlier Access Automatically Saves the Moment you leave the record.

And yest you can add a Save button to do what you want, but it wont do anything because you will leave the Record in order to Click on the Button. So before you get to click it, everything is already saved.

You are using Bound Forms arn't you. I did ask this question earlier.
 
The only Record that is not Saved is the Record that you are on.

As I said earlier Access Automatically Saves the Moment you leave the record.

And yest you can add a Save button to do what you want, but it wont do anything because you will leave the Record in order to Click on the Button. So before you get to click it, everything is already saved.

You are using Bound Forms arn't you. I did ask this question earlier.


Yeah all the forms are bound.

Here is an example of what I am trying to explain. Please see attached pictures.
 

Attachments

  • Pic1.JPG
    Pic1.JPG
    73.1 KB · Views: 312
  • pic2.JPG
    pic2.JPG
    61.2 KB · Views: 291
I'm not seeing any problems here. Your Create New Class button is doing what it was programmed to do. Look at the number of records in the navigation pane (i.e. at the bottom), it increased from 3 to 4.
 
I agree. Everything does what you say you want.
 
So you have found what to do.

Good to Hear.
 
So you have found what to do.

Good to Hear.


I'll try to see what I can do. Because I really have little experience about macros and VB.

EDIT:

I still can't make it work. Adding the navigation button is the easiest way but clicking save and new record button for like 4-5 times is really inconvenient.

I tried this code, but it only saves the data of the main form.

'------------------------------------------------------------
' btnSavenNew_Click
'
'------------------------------------------------------------
Private Sub btnSavenNew_Click()
On Error GoTo btnSavenNew_Click_Err
On Error Resume Next
If (Form.Dirty) Then
DoCmd.RunCommand acCmdSaveRecord
End If
If (MacroError.Number <> 0) Then
Beep
MsgBox MacroError.Description, vbOKOnly, ""
Exit Sub
End If
On Error GoTo 0
DoCmd.GoToRecord , "", acNewRec
DoCmd.GoToControl "AccidentTypeDescription"

btnSavenNew_Click_Exit:
Exit Sub
btnSavenNew_Click_Err:
MsgBox Error$
Resume btnSavenNew_Click_Exit
End Sub



Still need help, badly. :(
 
Last edited:
Bumping on this.

Please someone take a look at the code.
 
but clicking save and new record button for like 4-5 times is really inconvenient.

I don't know what the problem is but I have told you before that if you move away from a Record it is automatically saved. There is no need to click on anything 4-5 times.

What is it that you don't understand.
 
I don't know what the problem is...
neither do I.

But if you want your save button to work, then it needs to be placed in the subform or you have to set focus to the subform before the save command is run.
 
Is it possible to setfocus to multiple subforms? Does that make sense?
 

Users who are viewing this thread

Back
Top Bottom