473,804 Members | 2,296 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Data Capture with many Textboxes (VB and MS Access)

14 New Member
Hi

I've got a form for Data Capture with loads of Text boxs with the same name, except with a different number at the end, oh and im using VB 2005

i.e.

txtName1 txtDOB1
txtName2 txtDOB2
... ...

I need to get all text boxes ending with "1" into a Row in my access database and all textboxes ending with "2" into another row, and so on...

What I want to know is there a way to do this without having to write a line of code for each text box?

Something like this (and i know this doesnt work):

For NUM = 1 to 11
tblUser.Row(ROW ).Item(1) = txtNameNUM
Next
Feb 12 '08 #1
4 1953
kadghar
1,295 Recognized Expert Top Contributor
i'll asume you're using a version of vb that does not support indexes, so, yes, use them as controls:

Expand|Select|Wrap|Line Numbers
  1. dim Str1 as string
  2. for i = 1 to 10
  3.     str1= str1 & form1.controls("textbox" & i). text
  4. next
will give you textbox1 to textbox10 into the string... well thats the main idea.
HTH
Feb 12 '08 #2
Baladin
14 New Member
cheers thats exactally what i need
Feb 13 '08 #3
Baladin
14 New Member
it doesnt seem to work i get this error message:

Feb 13 '08 #4
Baladin
14 New Member
It's alright I've worked it out,

cheers that really helps, saves a lot of code writing
Feb 13 '08 #5

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

Similar topics

1
14950
by: Yanik Reid | last post by:
When I run the following vb.net code, I'm not able to acces the my database AMFLIB. I use to be able to access AMFLIB with the old ODBC driver from IBM iSeries Access but now I want to use the new managed IBM.Data.DB2.iSeries data provider from iSeries Access V5R3. When I remove Database=AMFLIB from the connection string, I can connect but as soon as I try to specify a known database (like my good old AMFLIB) I get the following error:
3
1824
by: phong.lee | last post by:
Hello all, i'm new at this. I need some assistant in transferring data from excel to access. I created a macro that basically gather all the necessary data that i need to bring into access. I also created a table in access with the correct columns to store the data from excel. Is there a way in VBA code that i can write so that when the data that i need can be automatically transfer into my access table? Thank you
4
11838
by: authorking | last post by:
I use the following code to insert a data record in to a datatable of an access database.But every time I execute the command, there will rise an exception and the insert operation can't be completed. here's the code: System.Data.OleDb.OleDbConnection hist_cnn = new System.Data.OleDb.OleDbConnection(); System.Data.OleDb.OleDbCommand hist_command = new System.Data.OleDb.OleDbCommand();
2
1009
by: JIM.H. | last post by:
Hello, can I add only one regular expression component and validate many textboxes? Thanks, Jim.
6
2159
by: saturnius | last post by:
Hello, I have to create data input forms to capture data (for sql server). I was just wondering weather there is an automated way (like using the datagrid) to link the "textbox.text" with the update command of the data adapter …. Many thanks in advance!
8
1219
by: Randy | last post by:
I have a form with 36 text boxes on it. I have everything working for the user to make changes to existing records or to add new ones. When I come to the point of passing this data on to the data source, I'm looking for an efficient way to do this. The only way that I know of is a line-by-line procedure that passes each textbox to the appropriate field in the data table one-by-one. Example: Dim drNew As DataRow drNew =...
0
1088
by: manbassie | last post by:
I have xml web service which returns a dataset. I have textboxes which need to be populated with this data and my problem is how to bind the data to the textboxes when the form loads and be able to navigate forward and backwards in the records. i have no problem populating a datagrid. By the way i'm using vb2003 and this is a windows app:
1
1737
by: dbalan | last post by:
I have excel file where the data is in horizontal manner. I have an output in access table, in vertical manner. I have a snap shot of data which I would like to attach which better describes my issue. Let me how I can attach. So if you see the excel i have employees and Dept that I need to apply to all my projects with the respective percentages. I have similar data across many sheets in excel, so I have created a column in output to know...
2
2639
by: shalskedar | last post by:
In the excel sheet attached below can the particular data b transfered to Access. The data is more of the dimensions data i.e the tabular data in the sheet has to go to Access...Based on the data various other Reports can b generated... Plz let me know how to transfer this data from various sheets to Access...
0
9714
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
9594
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
10346
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10347
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,...
0
6863
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4308
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
3832
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3001
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.