473,405 Members | 2,338 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Adding date and string to lisbox

I have a text box, a calender and a listbox on a form. i want to be able to select the date from the calender, type numbers in the text box and click add. i then want it to display the date then the number entered into the listbox. I have the following code which validates the text box so that only numbers can be added. How can I add to this. Thanks

If IsNumeric(txtentreading.Text) = True Then
lbreading.Items.Add(txtentreading.Text)
txtentreading.Clear()

Else

MessageBox.Show("Invalid gas meter reading. You must enter digits", "Message", _
MessageBoxButtons.OK, MessageBoxIcon.Error)
txtentreading.Clear()
txtentreading.Focus()
Nov 20 '07 #1
1 950
kadghar
1,295 Expert 1GB
I have a text box, a calender and a listbox on a form. i want to be able to select the date from the calender, type numbers in the text box and click add. i then want it to display the date then the number entered into the listbox. I have the following code which validates the text box so that only numbers can be added. How can I add to this. Thanks
use de DateAdd function, d is for days, something like this should do:

Expand|Select|Wrap|Line Numbers
  1. dim Dat1 as date 'lets say you save here what you got from the calendar
  2. msgbox (dateadd("d", textbox1.text, dat1))
HTH
Nov 20 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: 6thirty | last post by:
Hi, I've created a stocktaking database using Access XP. This is indexed by two fields - part number and shelf location. I am currently inputting all the data via a form. When I have entered a...
3
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that...
5
by: Doug | last post by:
I am looking at using the decorator pattern to create a rudimentary stored proc generator but am unsure about something. For each class that identifies a part of the stored proc, what if I want to...
1
by: Doug | last post by:
I am looking at using the decorator pattern to create a rudimentary stored proc generator but am unsure about something. For each class that identifies a part of the stored proc, what if I want to...
2
by: John Dann | last post by:
I have a standard .Net DateTime variable to which I want to add a time value. The catch is that the time value is only readily available as a string as "HH:mm". Question is whether there's a...
17
by: ginajohnst | last post by:
Hi All. I'm having a problem adding days to a date. My date is in the string format dd/mm/yyyy eg. 23/08/2007 in my form field. I can't work out how to add 50 days to that date and then...
1
by: snowrupa | last post by:
Here is my code.while i am trying to run this code.Error is raising.Can any one help me in this? Column 'Trans Seq No' does not belong to table . protected void Page_Load(object sender,...
1
by: swethak | last post by:
Hi, I am desiging the calendar application for that purpose i used the below code. But it is for only displys calendar. And also i want to add the events to calendar. In that code displys the...
13
by: phobia1 | last post by:
The simple code below gets data from a Location field and puts them into a lisbox. What I want to do is to be able to select one from the list and run a new function. How to get $areasearch valid?...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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
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,...
0
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...

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.