473,657 Members | 2,530 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.T ext
*************** ****
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 2784
On 5 Aug 2004 13:04:27 -0700, ed********@hotm ail.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.T ext
sDate = me.txtDate

sDate = me.txtDate.valu e

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.I NDIVIDUAL.NET>. ..
On 5 Aug 2004 13:04:27 -0700, ed********@hotm ail.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.T ext


sDate = me.txtDate

sDate = me.txtDate.valu e

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
1901
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 the module I am having an issue with. Can anyone help!
1
1285
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 information: Error in dll_sql_ExecSQL Error code: 546 Parameter not found in the list of params Error code: 610 OpenSQL: Error:546
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 OleDbParameterCollection" whenI try to write a new record. Delete and Modify work fine its just the add record function causes the error.
9
9682
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 master-child link to the first subform. subform2 - Master Field: subTrainingModule.Form!TrainingModuleTopicSK Child Field: TrainingModuleTopicSK
4
2095
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; using System.Collections; using System.ComponentModel; using System.Data; using System.Drawing; using System.Web; using System.Web.SessionState; using System.Web.UI;
5
1201
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#" Codebehind="Accomplishment.aspx.cs" AutoEventWireup="false" Inherits="Accomplishments.Accomplishment" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <HTML> <HEAD> <title>Accomplishment</title> <meta content="Microsoft Visual Studio .NET...
2
2422
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 column 'EmployeeID', table 'Accomplishments.dbo.Accomplishment'; column does not allow nulls. INSERT fails. The statement has been terminated. and my code is this using System; using System.Collections;
3
2305
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 FormUpdateSQL1... when i open the viewall window and click on the particular row and click on the buttion view selected on i m getting this error : Invalid use of Null.. i have changed everything which i knew.. i dont knw wht else i should do.. i m...
7
4435
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 surrendered to you. <%@ Language=VBScript%> <%Option Explicit%>
3
3592
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! I'm working on setting up a shopping cart for a one-product web site, and I'm using HTML and CSS, with ASP for the shopping cart. The ASP takes the information from the form on the shopping cart, and formats it in to two e-mails: one for the company...
0
8421
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8325
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8844
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8518
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6177
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2743
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1971
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1734
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.