| | |
Pass Controls of Access-Form to sub in module
Thread Solved |
•
•
Join Date: Mar 2006
Posts: 3
Reputation:
Solved Threads: 0
I'm working on a MS-SQL-Server-DB with MS-Access.
There are some dozens of forms.
I'd like to translate the forms by button-click into another language.
I've made a procedure (sub) called by button-click which walks over the complete "Controls" and changes the captions.
So far, so good.
But this procedure (in a test-form) will become more and more complex and so I would like to declare this procedure outside of the forms for easier maintainance (it's not very comfortable to change the code in dozens of forms for each new feature/bug-correction).
So I declared a new module (not class-module) and inserted the procedure in the module. But I have to pass the list of controls (in the form simply referenced by "Controls" or "Me.Controls") to this procedure. But now the moment has come when I started asking friends and googling, as the pass didn't work.
I've tried many versions, but there was always an error:
mostly "Error while compiling: Argument not optional" (I hope you know what I mean because I'm from Austria and I'm working with German Version of Access)
Maybe I've overseen something because I've started with access a few months ago but I'm a programmer nearly 20 years now (pascal, modula-II, fortran, java, javascript, php, ...)
in the Form:
in the module:
I hope this is clear enough for some of you to help me
There are some dozens of forms.
I'd like to translate the forms by button-click into another language.
I've made a procedure (sub) called by button-click which walks over the complete "Controls" and changes the captions.
So far, so good.
But this procedure (in a test-form) will become more and more complex and so I would like to declare this procedure outside of the forms for easier maintainance (it's not very comfortable to change the code in dozens of forms for each new feature/bug-correction).
So I declared a new module (not class-module) and inserted the procedure in the module. But I have to pass the list of controls (in the form simply referenced by "Controls" or "Me.Controls") to this procedure. But now the moment has come when I started asking friends and googling, as the pass didn't work.
I've tried many versions, but there was always an error:
mostly "Error while compiling: Argument not optional" (I hope you know what I mean because I'm from Austria and I'm working with German Version of Access)
Maybe I've overseen something because I've started with access a few months ago but I'm a programmer nearly 20 years now (pascal, modula-II, fortran, java, javascript, php, ...)
in the Form:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
'Click at button Private Sub Befehl18_Click() TestTranslate.ChangeControls (Me.Controls) End Sub
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Sub ChangeControls(pControls As Controls) ... End Sub
I hope this is clear enough for some of you to help me
•
•
Join Date: Mar 2006
Posts: 3
Reputation:
Solved Threads: 0
SOLVED
I've got the solution. It was a beginners mistake.
Although I've already written many, many procedures and procedure-calls that worked fine
I typed a syntax-error in this situation (in reminiscence of pascal maybe).
the call of the procedure should be:
(without the parentheses)
now it works fine.
I'm very sorry for bothering you with such a mess
I've got the solution. It was a beginners mistake.
Although I've already written many, many procedures and procedure-calls that worked fine
I typed a syntax-error in this situation (in reminiscence of pascal maybe).
the call of the procedure should be:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
TestTranslate.ChangeControls Me.Controls
now it works fine.
I'm very sorry for bothering you with such a mess
![]() |
Similar Threads
- How to open pdf documents from a Microsoft Access Form (MS Access and FileMaker Pro)
- How do I pass data in string from a form to another? (Visual Basic 4 / 5 / 6)
- Access in many form (Pascal and Delphi)
- Blinking Feild in Access (Geeks' Lounge)
- Access form expression help (Computer Science)
- Can we Programaticall Write code in VB6.0, forms/standard module/class code window (Visual Basic 4 / 5 / 6)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: VB6 and MSAccess
- Next Thread: Compiling VB6 crash - now with more information
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





