473,396 Members | 1,998 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Passing form to a sub procedure

Hi! I have a sub procedure that populate a combo box. I have that same combo
box on many form. So I would like to pass the form that call the sub as a
parameter of the sub procedure...
somthing l;ike this...
Public Sub populateFamilyCombo(ByVal this As form)

this.combobox.text = "blahblah example"

end sub

and I'd call it like populateFamilyCombo(me)

Anyone!?!?!?!?
Nov 21 '05 #1
3 954
Jean,

Why not pass the combobox to be filled to the sub?

Kerry Moorman

"Jean Christophe Avard" wrote:
Hi! I have a sub procedure that populate a combo box. I have that same combo
box on many form. So I would like to pass the form that call the sub as a
parameter of the sub procedure...
somthing l;ike this...
Public Sub populateFamilyCombo(ByVal this As form)

this.combobox.text = "blahblah example"

end sub

and I'd call it like populateFamilyCombo(me)

Anyone!?!?!?!?

Nov 21 '05 #2
"Jean Christophe Avard" <NO***@M.BITCH> schrieb im Newsbeitrag
news:O0*************@TK2MSFTNGP10.phx.gbl...
Hi! I have a sub procedure that populate a combo box. I have that same
combo box on many form. So I would like to pass the form that call the sub
as a parameter of the sub procedure...
somthing l;ike this...
Public Sub populateFamilyCombo(ByVal this As form)

this.combobox.text = "blahblah example"

end sub

and I'd call it like populateFamilyCombo(me)

Anyone!?!?!?!?


Why don't you pass the combobox instead of the whole form?

Better approach is probably to derived your own combo from the default
combobox and add the code there. Afterwards, put your own combo on each
form. You won've have to pass anything.

Armin

Nov 21 '05 #3
thank you guy!
"Armin Zingler" <az*******@freenet.de> wrote in message
news:Ow*************@TK2MSFTNGP10.phx.gbl...
"Jean Christophe Avard" <NO***@M.BITCH> schrieb im Newsbeitrag
news:O0*************@TK2MSFTNGP10.phx.gbl...
Hi! I have a sub procedure that populate a combo box. I have that same
combo box on many form. So I would like to pass the form that call the
sub as a parameter of the sub procedure...
somthing l;ike this...
Public Sub populateFamilyCombo(ByVal this As form)

this.combobox.text = "blahblah example"

end sub

and I'd call it like populateFamilyCombo(me)

Anyone!?!?!?!?


Why don't you pass the combobox instead of the whole form?

Better approach is probably to derived your own combo from the default
combobox and add the code there. Afterwards, put your own combo on each
form. You won've have to pass anything.

Armin

Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: WGW | last post by:
Though I am a novice to MS SQL server (2000 I believe), I can do almost! everything I need. Maybe not efficiently, but usefully. However, I have a problem -- a complex query problem... I can...
2
by: zlatko | last post by:
There is a form in an Access Project (.adp, Access front end with SQL Server) for entering data into a table for temporary storing. Then, by clicking a botton, several action stored procedures...
10
by: Resant | last post by:
I have a query : Exec 'Select * From Receiving Where Code In (' + @pCode + ')' @pCode will contain more than one string parameter, eg : A1, A2, A3 How can i write that parameters, I try use :...
2
by: Bob | last post by:
I'm new to Access projects and SQL server and am not a veteran VB programmer. There's a cry for help! I'm attempting to print the current form on screen by using a command button which the user...
39
by: Mike MacSween | last post by:
Just spent a happy 10 mins trying to understand a function I wrote sometime ago. Then remembered that arguments are passed by reference, by default. Does the fact that this slowed me down...
8
by: Johnny | last post by:
I'm a rookie at C# and OO so please don't laugh! I have a form (fclsTaxCalculator) that contains a text box (tboxZipCode) containing a zip code. The user can enter a zip code in the text box and...
11
by: John Pass | last post by:
Hi, In the attached example, I do understand that the references are not changed if an array is passed by Val. What I do not understand is the result of line 99 (If one can find this by line...
1
by: David Shorthouse | last post by:
Hey folks, I am attempting to pass null as the input value from a series of textboxes if the user does not input a value prior to submit. To try and do this, I am using a vbscript function on...
2
by: Nab | last post by:
I have just tried to pass parameters to a procedure in VB 2005 and realised that you only need to pass the input parameter. The output parameter's value will be returned without the need to pass it...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.