473,387 Members | 1,548 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,387 software developers and data experts.

Auto populate a field in VB ASP.NET

Hi All,

FACTS:

> I've created a VB.NET 2005 form, with a SQL Server 2000 backend
> The form has about 30 fields that populate 30 columns in the SQL database
> The form has mostly text feilds, with standard info such as Customer, order Number, etc.
> Im trying to autopopulate one of the feilds on the form, called Reference Number.
> The SQL column on the backend auto increments fine
> The Reference Numbercolumn has identity specification 'Yes', Increment '1', etc.

WHAT IS WORKING:
> I fill out all the fields on the .aspx form, it populates the database fine
> The Reference number auto increments by 1, which is great


WHAT I WANT:
> Employee should be able to launch the form, and have the Reference Number field auto populate on the form.


QUESTION:
> Should the Reference Number part of the VB.NET web form be a label?

A text box accepts input from a user... but in the case of the Reference Number, the user should have it automatically populated open launching the page. sounds like a label to me.

Any help, code samples would be appreciated.

Thanks,

Best,
Paul
Jun 2 '09 #1
2 4722
tlhintoq
3,525 Expert 2GB
A label would certainly work. Does it give you the visual appearance you want on the form? If everything else is a text box, maybe using a textbox would give you a more consistent appearance. Setting it to "read only" would keep people from changing the value. Changing the backcolor to something slightly off from the other textboxes gives the look that it is *meant* to not be changeable. You could also just set it to "enabled = false" to give it a dimmed appearance, not changeable, yet still readable.

So yes, a label will work. Do you like how that looks?
Jun 2 '09 #2
Well, tlhintoq, your absolutely correct. A text box is better, set as read only - and changing the back color to show its not supposed to be changable. Your already getting me in the right direction!!

Now... how do I get this Text box populated with the auto increment from the database. It probably starts with some code in a Page_Load event... since a page load by the visitor is the event that fires the web form.

Thanks again!
Paul
Jun 2 '09 #3

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

Similar topics

1
by: John | last post by:
I have two fields on a form. Once called School, the second called SchoolZip I want the users to be able to go to the ComboBox field called School, select the school they want, and have it auto...
1
by: John Phelan-Cummings | last post by:
I'm not certain if this made the post. Sorry if it's a repeat: Using a Button to take an autonumber from one form to populate another autonumber field on another form. I have a Mainform "A"...
1
by: Jim | last post by:
I have a new database in which I have a form where in one field I type a letter A, B, C or D and the field next to it autofills (auto lookups) with a description associated with the specific...
2
by: keri | last post by:
Hi, I'm still struggling with my tables - frustrating. If a field in table one is completed I want the following field to auto populate (dependng on the answer to the first field). I have...
2
by: alphaomega3 | last post by:
OKay here is the situation. I am creating an inspection log database and have previously created an Non-conformance database. I am trying to get the NCRno field to auto-populate after I update the...
3
by: jacklindsay | last post by:
Hello smarter people than me I am creating a database for college, and have requested some help, but they are unable to help me. ( im obviously too eager) anyway, im creating a database on...
5
by: joshua.nicholes | last post by:
I have an access database that consists of two tables.A data collection table and a species list table. The data collection table has about 1500 records in it and the species list has about 600....
4
by: whamo | last post by:
I have the need to populate a field based on the selection in a combo box. Starting out simple. (2) tables tbl_OSE_Info and tbl_Input; tbl_OSE_Info has three fields: Key, OSE_Name and OSE_Wt...
3
by: Puzzled and Confused | last post by:
It seems like a simple request, but I cannot get it to work. Does anyone know to how to make data from one field auto populate in another field, only if the answer is yes/true? I have a form that I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...

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.