473,511 Members | 16,110 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

error from getting value from a text box

Hi,
I am making changes to an Access application that was written by a
previous coworker.

All I am tring to do is to get the text from a text box called
txtDate, and assign it to a string variable.
************
Here is my code:

Private Sub Button1_Click()

Dim sDate As String
sDate=txtDate.Text
*******************
Here is the error from Access/VB
"Compile error: Expected: end of statment"
********************

Can someone tell me why this doesn't work? How can I get the text
value from the text box and reassign it to a variable?

Thank you in advance,
Eddy
Nov 13 '05 #1
2 2777
On 5 Aug 2004 13:04:27 -0700, ed********@hotmail.com (eddie wang)
wrote:
Hi,
I am making changes to an Access application that was written by a
previous coworker.

All I am tring to do is to get the text from a text box called
txtDate, and assign it to a string variable.
************
Here is my code:

Private Sub Button1_Click()

Dim sDate As String
sDate=txtDate.Text
sDate = me.txtDate

sDate = me.txtDate.value

When you run into a problem like this, type crtl-G and enter debug
mode. Then you can play around with things until you get the right
syntax.

Typing:

? txtDate.Text

should generate the same error

but, typing

? txtDate.value

shouldn't.

me.$0.02

ringo
*******************
Here is the error from Access/VB
"Compile error: Expected: end of statment"
********************

Can someone tell me why this doesn't work? How can I get the text
value from the text box and reassign it to a variable?

Thank you in advance,
Eddy


Nov 13 '05 #2
Thank you so much for the help!!

xx*@invalid.net (asdfg2k) wrote in message news:<41***************@news.INDIVIDUAL.NET>...
On 5 Aug 2004 13:04:27 -0700, ed********@hotmail.com (eddie wang)
wrote:
Hi,
I am making changes to an Access application that was written by a
previous coworker.

All I am tring to do is to get the text from a text box called
txtDate, and assign it to a string variable.
************
Here is my code:

Private Sub Button1_Click()

Dim sDate As String
sDate=txtDate.Text


sDate = me.txtDate

sDate = me.txtDate.value

When you run into a problem like this, type crtl-G and enter debug
mode. Then you can play around with things until you get the right
syntax.

Typing:

? txtDate.Text

should generate the same error

but, typing

? txtDate.value

shouldn't.

me.$0.02

ringo
*******************
Here is the error from Access/VB
"Compile error: Expected: end of statment"
********************

Can someone tell me why this doesn't work? How can I get the text
value from the text box and reassign it to a variable?

Thank you in advance,
Eddy

Nov 13 '05 #3

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

Similar topics

2
1889
by: WAYNEL | last post by:
Hi I am trying to re-write some of the example code that Agilent gives for VB to VB.Net. In .Net I keep getting the error 'cannot change the number of dimensions of an array'. I have paste...
1
1280
by: Jassim Rahma | last post by:
I am getting this error and i Don'r know where is the problem? please help.. An unhandled exception of type 'VistaDB.VistaDBException' occurred in vistadb.provider.dll Additional...
1
541
by: DC | last post by:
The problem I'm using the .NET GridView and FormView objects for the first time and im getting the error "An OleDbParameter with ParameterName '@ID' is not contained by this...
9
9667
by: Ecohouse | last post by:
I have a main form with two subforms. The first subform has the child link to the main form identity key. subform1 - Master Field: SK Child Field: TrainingMasterSK The second subform has a...
4
2087
by: preeti13 | last post by:
Hi friends i have a probelm i am try to pass the value to the employeeid parameter but getting th error please help me how i can do this i am getting the error here is my code using System;...
5
1193
by: preeti13 | last post by:
Hi friends i am getting the error in my application i don't know what to do please help me.i am useing a data bimder into my text box here is the my code <%@ Page language="c#"...
2
2408
by: preeti13 | last post by:
Hi guys i am here with my another probelm please help me.trying insert the value into the data base but getting the null value error .I am getting thsi error Cannot insert the value NULL into...
3
2296
by: squrel | last post by:
Hi everyone.. i have added one textbox called discount to one of my form to display the discount if it exists and also to enter in the textbox... i have button called viewall which is in the...
7
4428
vikas251074
by: vikas251074 | last post by:
I am getting error above in following code since few days giving tension day and night. How can I solve this? I am facing since Oct.25. in line no. 362 After doing a lot of homework, I am...
3
3588
by: graphicssl | last post by:
Okay, so first of all, I'm a designer first and a light coder second (I'm only really trained with HTML and CSS). So I apologize for having to post about something that's probably super-trivial! ...
0
7242
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7138
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
7353
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,...
1
7075
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
5662
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5063
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4737
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3222
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
781
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.