Get string from VB textbox into Table

68 views
Skip to first unread message

Steven Evans

unread,
Mar 5, 2007, 9:06:35 PM3/5/07
to mapi...@googlegroups.com
Hi Gang;
I am compiling some mapbasic code so that users can select a date from a pop up calendar. I have already got the calendar code in VB6 (no dll's - just straight code. Very simple and works well - courtesy of planetsource.com). I need to be able to get the date (as a string) from the textbox and drop it into a table. The table has only got one column and is only used as a temporary field.
Unlike an EditText control in mapbasic where you can give it an ID and then use ReadControlValue ID to get the text, I'm not sure how to insert this string into the table using VB. Mapbasic calls the VB code to run
 
I have tried the following in the VB code but it says my variable is not defined
 
Private Sub cmdOK_Click()
Dim resultdate, msg As String
resultdate = txtDate.Text
 
Set mapinfo = CreateObject("MapInfo.Application")
mapinfo.do "Open Table ""C:\PSC_Weeds\Re_date_temp"" Interactive"
 
     If (resultdate <> "") Then
        mapinfo.do "Insert Into Re_Date_temp Values (resultdate)"
    'End If
 
End Sub
 
Steven Evans
GIS Officer
Parkes Shire Council
Ph: 6861 2332
Fax: 6863 5931
There's no place like 148º 10' 20", -33º 8' 20"
 
 
 
 
 
 
 


Visit Parkes on the web at www.parkes.nsw.gov.au.


Attention: This e-mail is privileged and confidential. If you are not the intended recipient please delete the message and notify the sender. Any views or opinions presented are solely those of the author.


Message has been deleted

Uffe Kousgaard

unread,
Mar 5, 2007, 10:00:00 PM3/5/07
to mapi...@googlegroups.com
> From: Steven Evans

This is a vb variable:


> Dim resultdate, msg As String

Mapinfo do not know about your vb variable:


> mapinfo.do "Insert Into Re_Date_temp Values (resultdate)"

Replace with
mapinfo.do = "Insert Into Re_Date_temp Values ("+resultdate+")"

The correct syntax may require formatting of the date string !

Regards
Uffe Kousgaard

Reply all
Reply to author
Forward
0 new messages