How to save a change??

Gaufres

Registered User.
Local time
Tomorrow, 04:06
Joined
Jan 13, 2005
Messages
24
hi i am not good at programming and it was 5 years ago when I did VB.. please find an attachment .jpg called "Student-Form.jpg".

at the moment, when the user change either "Gender" and "Nationality" on the left side, the "Save" button at the bottom of the form will be available. if you just browse the information, this button is always greyed out.

this form is created by someone else who i don't know. i now added two subforms on the right top. it is currently looking ugly with the line.. (i dont' know how to get rid of this.)

i can click those combo box, i.e., "Enrolment Status", "Campus", and "Programme", and change to some other options. however, the "Save" button is still greyed out.. i have been told that i have to code for this subform.

i know this is so rude to ask, but can any one please give me any links i should look at, or some basic code that i could use for it.

how can i tell the main form (parent form? "Student Details" tab) that the subform ("Enrolment" and "Intake" dates info) has been changed?

i deeply appriciate your help.
Gaufres
 

Attachments

  • Student-Form.jpg
    Student-Form.jpg
    37.5 KB · Views: 140
Save

You have to put some code in the After Update Event of the combo box:

Forms!frmMain!SaveButton.Enabled = True

Replace 'frmMain' and 'SaveButton' with the actual names
of the form and the button.
 
Last edited:
sorry to ask but would the code go to the subform or the main form? would i have to have a separated "Save" button for the subform ("Enrolment" and "Intake" info)?

also, how do you check the name of the form? do you check by the property of the form or the name shown on the panel where all forms are listed.

the code something like this..?? i put this for the subform.



Option Compare Database

Private Sub Enrolment_subform_AfterUpdate()
Forms!frmStudent!cmdSave.Enabled = True
End Sub
 
Event Property

i just made it! :D

i didn't know i had to get my form in design view and right-click on the properties of the combo boxes. then go to the Event Tab, look for AfterUpdate, and choose code builder.. just in case there are someone who didn't know this stupid basic skills like me..

everything is working fine now. thank you so much, trucktime!! :)


Option Compare Database

Private Sub cmbCampus_AfterUpdate()
Forms!Student!cmdSave.Enabled = True
End Sub

Private Sub cmbEnrolment_status_AfterUpdate()
Forms!Student!cmdSave.Enabled = True
End Sub

Private Sub cmbProgramme_AfterUpdate()
Forms!Student!cmdSave.Enabled = True
End Sub
 
i now added two subforms on the right top. it is currently looking ugly with the line.. (i dont' know how to get rid of this.)
- Change the border property of the subform control.

Forms!Student!cmdSave.Enabled = True
Is NOT the correct way to address controls for the current form. Use Me.cmdSave.Enabled = True instead. It is more efficient and provides intellisense.

And finally, there is no need to add code to every control's AfterUpdate event. Just use the Dirty event. Then as soon as ANY change is made to the form, the Save button will become enabled.
 
Border Property??

Pat Hartman said:
- Change the border property of the subform control.

Is that "Border Style" on Format Tab? I've already selected "None" but the line still shows up.. Or am I looking at a wrong place?

I attached a pic of the property window.
 

Attachments

  • property.jpg
    property.jpg
    44.9 KB · Views: 154
"None" isn't an option that I see. "Transparent" gets rid of the border.
 
Pat Hartman said:
"Transparent" gets rid of the border.

thank you, Pat Hartman. my sub form is now transparent but so the main form is for some reasons..? and now i can't find where i found "transparent" option. but nevermind, i keep playing around it but i just want to say thank you.

Gaufres
 

Users who are viewing this thread

Back
Top Bottom