|
This may be a dumb question:
I have the variable Port of type integer declared in a module like this:
Dim Port as Integer
(in general declarations)
I then have it declared in each of my forms like this:
Dim Port as Integer
(in general declarations)
How do I pass the value of Port in my main form (frmMain) to another form called from frmMain?
David.
|
|
|
|
|
First of all, you have to change the declaration of Port from Private (Dim) to Public. Then you can just reference the variable using the form name. Ex:
form1.Port = frmMain.Port.
Hope this helps
Jason Gerard
MCSD, MCSE
Technology Point International, Inc.
|
|
|
|
|
You dont even have to declare it on each form. Just reference the one in frmMain as illustrated
by Jason.
Make it local to the function you are using it in
Private Sub cmdDoStuff_Click()
Dim iPort as Integer
iPort = frmMain.Port
' etc.
End Sub
|
|
|
|
|
Sir,
I want to know how to get full control over a scanner that is attached to system using VB API
|
|
|
|
|
I have a Variable Problem, that is being fill but I can't read it
I'm sending the variable to a DLL which is declared;
Private Declare Function GetList Lib "C:\Program Files\Microsoft Visual Studio\MyProjects\API\Debug\API.dll" _
(ByVal pszSch As String, ByVal pszQualifier As String, vNumber As Variant, ByVal pszMessage As String) As Long
The Function that calls this DLL is;
Private Sub Command1_Click()
Dim xStatus As Integer
Dim pszSch As String
Dim pszMessage As String
Dim pszQualifier As String
Dim vNumber As Variant
ReDim vNumber(2002) As String
pszSch = "TEST"
pszQualifier = " 'COM_NUM' = 123"
pszMessage = Space$(255)
xStatus = GetList(pszSch, pszQualifier, vNumber, pszMessage)
MsgBox vNumber(x), vbInformation, "vNumber"
Text1 = vNumber(x)
The MsgBox line with the vNumber will display the value in the variable
But the Text1 line shows nothing for the variable
What do I do to read this variable without the message box ?
thanks
|
|
|
|
|
I hope that this will work
Text1.Text = trim(cstr(vNumber(x)))
since the return variable is Variant type, before getting its value to the text box convert it into text type.
Raveendra Madupu
Member Technical Staff
Network Programs India Limited
raveendra@engineer.com
|
|
|
|
|
I would say that if vNumber should be a numerical value, explicitly cast it to what you need it to be. It is probably turning into a string. Set a breakpoint at the MsgBox line and set a watch on vNumber(x). That will probably help you determine how the data is kept and what you need to do with it.
Text1.Text = CInt( vNumber( x ) )
By the way, is x declared elsewhere?
|
|
|
|
|
can we run our exe when ever an outlook runs
|
|
|
|
|
Here is an easy way to do it: Write a VBA script in OutLooks script editor.
In the Application_Startup event, call Shell "OurExe.exe"
|
|
|
|
|
can we run our exe when ever an outlook runs
|
|
|
|
|
hey im Craig .. i am making a IRC bot for msn chat servers, would anyone help me find out were i can get sorce code to scan for bad lanague in a chatroom? i will be very thank ful if anyone can tell me!!
thanks
im new to this so go easy on me
Craig
|
|
|
|
|
Dear friends,
If anybody know how to build mail server using visual basic. I saw possibility using winsock, but i am confused while thinking about smtp server, po3 server and imap4 server in visual basic. If someone know this, please help me.
Bishnu pokharel
|
|
|
|
|
i dont know actually but u can use cdonts.dll for this.
we can send mail with this
|
|
|
|
|
I want to know that how can I add different numeric values seperateed by
commas from a textbox as child nodes in different existing child nodes?
usama
|
|
|
|
|
Use the split function to get the variant array of the values entered in the textbox.the child nodes can be added for the existing child node by using this array.
|
|
|
|
|
i have this project which requires me to give change and also in the form of dollars, quarters, dimes, nickels, and pennies?
|
|
|
|
|
I am a student at a cheap school and we are making a cheap game.
I have to make a game with Delphi 4.0 that is gonna whipe the
floor with the other students' games.
We worked on Frogger, I still haven't finished it yet.
*someone tell me how to make my frog die when he gets squished
by a truck.
Anyways I want to make a side-scrolling adventure game like
Mario from the NES but the problem is... I am an amateur
programmer and I need a team.
So this is my plan, I get help from friends and you guys
(friends , I make my images and you give me codes to make my
game work. I am no dum nut but if there would be a time-generous
person reading this and thought maybe he could help this guy
make a cheap game then he would profit in joy later on with
credit.
these questions have got to be answered soon. big favor needed.
Where do I start?
How do I make a side-scroller?
How do I make my HERO die and lose a life?
(I got most of that down)
How come my games are so choppy? I mean like it warps from point
A to point B and it ain't smooth.
I know FLASH 5 and I can animate stuff with it.
*Score one over the class
I am on MSN Messenger with gamepraiser@hotmail.com
and I really need a programmer friend here.
|
|
|
|
|
Hi,
I have developed a vbcomponent(Activex dll).the component has the function
like this SynonyList(Words, WordList, MeaningArray, cou)-Words,wordlist,meaningarry,cou are variant. if u pass a word in this fucntion it
returns wordlist,meaningarry as array of strings,cou as integer.if i use this
in vbscript it works .but javascript i don't know how to pass it to the function.
pls give me ur suggestions.
|
|
|
|
|
I think this process of component instantiation is works good
function fun1()
{
var objVar;
var x;
objVar = new ActiveXObject("ProgID");
x = objVar.YourMethod(required Aurguments);
}
Raveendra Madupu
Member Technical Staff
Network Programs India Limited
raveendra@engineer.com
|
|
|
|
|
i don't think that foryou
ghlooooooooooooooooooooooo
|
|
|
|
|
I search any developper for exchange sample code Visual Basic with Adobe Product (Acrobat, InDesign, Frame)
Thank a lot.
|
|
|
|
|
Is it possible to some how pass IN a recordset to a stored procedure? I want to be able to do something like the following:
Alter Procedure uspBillClient
@RS Recordset
As
Begin
Update Bills
Set BillID = (Select MAX(BillID) From Bills) + 1
Where HoursID In RS
End
Thanks in advance for any help.
Jamie Nordmeyer
Portland, Oregon, USA
|
|
|
|
|
I have developed a client-server application in VB6 and SQL Server 7 as backend. The application works fine in our intranet. But I want to connect to the SQL Server physically located in our second office which is in different city. We have a fixed IP address. I am facing a problem in connecting to the SQL server. I have tried with DSN, provider, .udl file. How do I accomplish ths?
|
|
|
|
|
I have done this many times with the following code. Basically, I create a connection string and use ADO and OLEDB to perform the connection. Here is a code snippet.
strServerName = "127.0.0.1" ' Substitute your IP Address here
strDatabaseName = "YourDB" ' Substitute your Database name
strUserName = "YourUser" ' Substitute your UserName
strPassword = "Password" ' and Pasword here.
' Initialize the database connection string
mstrConnStr = "server=" & strServerName & ";database=" & strDatabaseName & ";provider=SQLOLEDB;uid=" & strUserName & ";pwd=" & strPassword
' Instantiate an ADO Connection Object - Trivial code left out
' Then, open the connection.
mobjConn.Open mstrConnStr
' Do some error checking here
That's all there is to it!
Rob
|
|
|
|
|
You need to make sure that the SQL Server is set up to use TCP\IP protocol and then on your client machines in the setup of the DSN you need to make sure they are trying to connect via TCP and not Named Pipes (which would only work in you intranet).
Jason Cono, MCSD
|
|
|
|