-
Form Templates
Is it possible to create a form template that has the same buttons and same code behind it.
For example. I have about 10 forms which are inputs into various tables. The forms all contain buttons which all perform the same functions, for example add, print, delete etc.
Is it possible to create a collection of buttons which I can invoke on each form withouth having to recreate the buttonset?
-
You could create a function to do such actions.
[vba]
Sub Function action_to_do(vaction as string, vtable as string)
Select Case vaction
Case "add"
code to insert to vtable
Case "delete"
code to delete record from vtable
Case "modify"
code to update record from vtable
end case
End Function[/vba]
and in your commandbutton you say[vba]Call action_to_do("add","Orders")[/vba]Charlize
-
It is not necessary to use any VBA.
In the Forms section just copy the curent form and paste it with a new name.
All you have to do now is change the Data Source for the new form and it's fields.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules