|
I'm not sure if I got it correctly.....
if you want to have a single form1 and form2 then the solution is not to re-declare them inside the procedure but just once at the beginning of the code. Thay way you are going to recall always the same one without creating a new instance.
|
|
|
|
|
How do you go about doing that? Any help that you can offer will be greatly appreciated... Thanz
|
|
|
|
|
My point is to move the declaration outside the form.
A way of accomplishing it could be the following.
Create a module with a Sub Main (it has to be the starting sub of the project
Module xyz
public F1 as new Form1
public F2 as new Form2
public sub Main
F1.Show
while F1 is not nothing
application.doevents()
wend
end sub
and then for each form/button event
private sub Button1_Click(..)
F1.Hide (F2.Hide in the other form)
F2.Show (F1.Show in the other form)
end sub
Remember to unload Form1 to end the application
|
|
|
|
|
what command do you use to unload a form?
|
|
|
|
|
Just issue the close method over the form. It'll be closed (passing through the closing and close events) and then destroyed.
|
|
|
|
|
Hello again friends!!
I've a fairly simple problem w/c im unfortunately stuck at. Well, i'v 2 forms. form1 is the main page which shows some companies' names as a link. form2 is the page which allows you to edit, update and/or delete the given company. now here's my problem...everything works fine except for my date picker. Upon clicking my "setdate" button it shows the calendar and actualy sets the coresponding text box with the date you pick but when i try to save the form the date doesn't save at all. everything else including the company name, adress, tel number, etc is saved accordingly only the textbox with the date picked is not. Any ideas why not? here's my query on insert:
Public Function fInsert(ByVal strName As String, ByVal strID As Integer, ByVal strInbound As Integer, ByVal strOutbound As Integer, ByVal strDstart As String, ByVal strDend As String, ByVal strRemarks As String)
Try
strSQL = "Insert into Splits"
strSQL += " (SplitID, SplitName, Inbound,"
strSQL += " Outbound, DateStarted, DateEnded, Remarks)"
strSQL += " Values ('" & strID & "',"
strSQL += " '" & strName & "',"
strSQL += " '" & strInbound & "',"
strSQL += " '" & strOutbound & "',"
strSQL += " '" & strDstart & "',"
strSQL += " '" & strDend & "',"
strSQL += " '" & strRemarks & "')"
Dim cmdInsert As New OdbcCommand()
cmdInsert.CommandText = strSQL
cmdInsert.Connection = cnn
cmdInsert.ExecuteNonQuery()
Catch e As OdbcException
Throw e
End Try
Return True
End Function
Tanx so much!
Kampai!!!
-- modified at 3:03 Thursday 15th September, 2005
|
|
|
|
|
hi,
i think you should use ToDate convetion like Format or sonthing which you normaly use for database i use Format statement...... otherwise change that StrDStrart to a datetime format and then try to save in database instead of string .....
regards
ciacia
|
|
|
|
|
good call! thanx so much for the assistance!
Kampai!!!
|
|
|
|
|
Has anyone tried using the API NetSessionDel in VB.Net? I haven't had any success in my attempts so far - but I'm still not sure that I have the declaration correct.
Is there another method of deleting a user's session on a share?
Thanks in advance,
Paul.
|
|
|
|
|
I defined a Procedure
Public Sub SetDBConf(ByRef CN as ADODB.Connection)<br />
CN.Provider="Microsoft.JET.OLEDB.4.0"<br />
CN.Properties("Data Source")="[path to mdb file]"<br />
CN.Properties("Jet OLEDB:Database Passowrd")="Password"<br />
End Sub
When I call this procedure
Dim myCN as New ADODB.Connection
SetDBconf myCN
This procedure produces type mismatch error. How can I resolve it.
Shoaib Nawaz
|
|
|
|
|
HI,
I Have made a small change in you code . you initialize the ADODB object in called procedure insted of calling procedure.
here is the code
calling procedure
Dim CN As ADODB.Connection
Call SetDBConf(CN)
and
Public Sub SetDBConf(CN As ADODB.Connection)
Set CN = New ADODB.Connection
CN.Provider = "Microsoft.JET.OLEDB.4.0"
CN.Properties("Data Source") = "c:\frmmain\pathsoft.mdb"
CN.Open
MsgBox "opend"
End Sub
i think this will solve your problem......
bye
Regards
ciacia
|
|
|
|
|
suppose i want to connect to a site through ftp over SSL.how could i do it. i have downloaded many
source code for ftp, they work fine but can not connect to a specific site becasue those code
can not connect to that ftp site through SSL.so pls tell me how could i solve this problem
or give me few url from where i can download free cost advance ftp library which comes with all
the advance ftp feature.pls help me out.
tbhattacharjee
|
|
|
|
|
|
sir first of all thanks for ur response but my ftp problem is not solved. according to you i download the library for ftp over ssl but ftp client has only function for connection to remote server but i want that library should have function like filelist,uploadfiles,downloadfiles,rename,remove etc.so this type of feature was not, so if u know any other better solution then please help me.
tbhattacharjee
|
|
|
|
|
suppose at specific time or at specific time of sunday and monday a function will be called.
pls help me with sample code or give me a url from where can download free cost scheduling
library.i have download few library for scheduling but those are useless.so pls help me.
tbhattacharjee
|
|
|
|
|
have u tried this?
http://www.codeproject.com/csharp/taskschedulerlibrary.asp
|
|
|
|
|
Hi all,
I need to find a way if there is a way to send keys to an already open internet explorer page's text box. If it is possible a step by step explaination would be greatly appreciated. Thanks For Looking !!!
|
|
|
|
|
Sending text to a textbox in an HTML page that you have opened using a WebBrowser control in one of your own forms is pretty easy. You just enumerate the html elements until you find the textbox and you can input anything you like.
However, hooking into a running instance of for example IE6 is extremely complex. You have to find the correct COM interfaces for the browser application, and that is just the beginning. You can search for articles on CP about hooking into IE, but it is a very, very difficult task.
|
|
|
|
|
Hi everyone,
Can someone help me with following code
Dim temp1 as decimal
dim temp2 as decimal
dim result as decimal
temp1 = CDec(txtvalue1.text).tostring("N4")
temp2 = Cdec(txtvalue2.text).tostring("N4")
result = temp1-temp2
txtfinalvalue.text = Cstr(result)
what is wrong in the above code? I have decimal values in two textboxes and I need to subtract them and display the result as a decimal value into the third textbox.
thankyou all in advance
Aartee.
...HE is watching Us All!
-- modified at 21:50 Wednesday 14th September, 2005
|
|
|
|
|
BORN...again! wrote:
temp1 = CDec(txtvalue1.text).tostring("N4")
temp2 = Cdec(txtvalue2.text).tostring("N4")
r
Change this to:
temp1 = CDec(txtvalue1.text)
temp2 = Cdec(txtvalue2.text)
...Steve
|
|
|
|
|
Hi Steve,
Thankyou for your prompt help.
I tried it like you said but i still get the error as
"System.InvalidCastException: Cast from string "" to type 'Decimal' is not valid."
Any more tips?
thanks a ton
Aartee.
...HE is watching Us All!
|
|
|
|
|
One of those textboxes doesn't have anything in it when this code runs. Put those two CDel lines in seperate Try/Catch blocks to make sure the values are filled in with 0 if the strings enter into the textbox's are not valid numbers.
Try
value1 = CDel(textbox1.Text)
Catch
value1 = 0
End Try
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave is correct. You need to ensure the data being converted is valid before the conversion takes place otherwise an exception can be thrown.
...Steve
|
|
|
|
|
Thanks guys, I initialised the values of the variables and Bingo!thanks for all the help.
Aartee.
...HE is watching Us All!
|
|
|
|
|
I have a program that puts out asc code... and sends it to an overhead speaker system...
The problem is the program was made to send asc code to a camera controller and not audio controller.. So the asc is sent out before the radio receivers triangles on one area.. and the program continues to send out the asc codes making the camera relocate this is all fine.
But i need the com port to hold the data in a buffer until the area is found.
Thinking of using vb script or VB and use a counter then send the asc out on com2
rm130@ hotmail.com
|
|
|
|