Hi,
I am having trouble opening a form and editing a record based on the record i selected from my listbox. I have tried two codes and both failed..ill just state the codes here:
1st code:
DoCmd.OpenForm "AddNewBorrower", , , _
"[tblBorrowerDetails.BorrowerSerialNo]=" &...
Hi,
What is the best code to use in order to save the record and quit the form? I have a main menu so i will save,quit this form and go to main form
I have this code:
Private Sub testingsaveok_Click()
If Me.Dirty Then
Me.Dirty = False
DoCmd.OpenForm "BorrowerSection", acNormal
DoCmd.Close...
Hi,
I have read that the command AcSaveNo only saves the form, not data. So which code should i use to save the data in a form?
Heres my code
DoCmd.OpenForm "BorrowerSection", acNormal
DoCmd.Close acForm, "AddNewBorrower", acSaveNo
Hi,
Even if your foreign keys are all autonumbers, it doesnt matter if you tick or do not tick the cascade update amiright? Since its not advised to change autonumbers/primary keys. I only know that its neccessary to tick the cascade delete so that you are able to delete the related records.
Hm...but i have establish the relationships in the relationships windows. Perhaps i shall attach my database in this post and if possible could you take a look and see if my relationships are properly connected? Also, i noticed that when i deleted a record, it didnt cascade and subform records...
hmm i think the code did not work the way i wanted. I think this code still has problems.
The problem that still happens is that whenever i press the add new record button, the message prompt still appears. I just want the messagebox not to appear when i press this add new record button...
Then i would like the sub to not affect the record and go ahead with giving the msgbox. Anyways, i tested the code and it didnt undo the changes when i purposed click to another subform so i went to check your code...it did not have me.undo. So i added it in under the cancel true i
Private...
Ok so i just have to add the following code in right?Ill try it now
Private Sub Form_BeforeUpdate(Cancel As Integer)
'Ensure that users do not accidentally save records
If me.newrecord then exit sub
If MsgBox("Do you want to save the updated records?", vbOKCancel, "Save?") = vbCancel...
Ok but how do i add an exception to new records. SInce this code fires whenever the form is dirtied, then this would be a problem as new records are not accidental and are to be added in intentionally.
Edit:My previous code works the same as your code right? If so, the sub will surely affect...
I only added the code you gave me.Ok I just want to add my reason for doing this.My form has 2 subforms on it and i intend to add a new record button to each of them so that the only way you can save the records are to click on the buttons.Or maybe i would just add a save button and new record...
Alright i have added in the in code that you gave me. what im going to do now is add a new record button using the wizard. Hope it works
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Me.Dirty Then
'Ensure that users do not accidentally save records
If MsgBox("Do you want to save the...
So i have this code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Me.Dirty Then
'Ensure that users do not accidentally save records
If MsgBox("Do you want to save the updated records?", vbOKCancel, "Save?") = vbCancel Then
Me.Undo
End If
End If
End Sub
How do i add a code inside that...
Yes is it the cancel before integer? So what do i do with it. Can you give me an example of what i should do and how it relates to the button that i want to create.
How do i create a button that saves the current record and moves to a new one? I want to do it in such a way that microsoft access acknowledges the button.
Below is the following codes in my form:
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Me.Dirty Then
'Ensure that users do not...
Hi,
How do i minimise my form so that it is centred in the middle of the screen? I want to have my form all centred in the screen so it maintains consistency. Also if possible, can anyone tell me how to modify the forms size because i want my switchboard to be bigger than my entry forms but...