|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Access From - Saving
I have created a VB Project that uses an Access Application object to modify an existing form in the database. I am able to dynamically add controls to the form. However, I can't get it to save the form. i.e. When I open it, the newly added controls are not there.
Can anyone help with the last step which is to save the form? Code: ' Create the Application object. Set loA = CreateObject("Access.Application") ' Open the desired database. loA.OpenCurrentDatabase msNewDBPathAndFile loA.Visible = True ' Open the Existing "Template" Form. loA.DoCmd.OpenForm FORM_NAME__IMAGE_DATA, acDesign loA.DoCmd.SelectObject acForm, FORM_NAME__IMAGE_DATA Set loForm = loA.Forms(FORM_NAME__IMAGE_DATA) ' Client and Project labels. loForm.Controls("lblClientName").Caption = txtClientName loForm.Controls("lblProjectName").Caption = txtProjectName . . . Here is where I want to save the form. I have tried the following: loA.DoCmd.Save loA.DoCmd.Close acForm, FORM_NAME__IMAGE_DATA, acSaveYes |
|
#2
|
|||
|
|||
|
Hi,
You have to tell VB which option (acForm) to use with the name of the corresponding form when you use save method otherwise vb doesn't always choose the right object. You can save your form like this : DoCmd.Save acForm, NameofYourForm |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > Access From - Saving |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|