473,396 Members | 2,140 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,396 software developers and data experts.

How to extract specific info from a space/cell from access into VB?

alright, hey everyone, I'm new here, and also new to VB, I'm trying to do an application that needs to generate 10 random names, I was looking for a way of maybe putting names in a access database, and extracting the info in the space/cell randomly and returning it into the label, but I didn't found out how 2 do it, so I did it the "hard way"
here's some code of the application that i wrote, (I'm not putting the whole code because it's a lot)

Expand|Select|Wrap|Line Numbers
  1.   If RadioButton1.Checked = False And RadioButton2.Checked = False Then
  2.             ErrorProvider1.SetError(Button1, "SELECCIONE EL GENERO PARA GENERAR NOMBRES")
  3.         Else
  4.  
  5.             Dim r As New Random
  6.             Dim num_al As Integer
  7.             num_al = r.Next(0, 4)
  8.  
  9.  
  10.             If RadioButton1.Checked = True And RadioButton2.Checked = False Then
  11.                 Select Case num_al
  12.                     Case 0
  13.                         Label4.Text = "Woody"
  14.                     Case 1
  15.                         Label4.Text = "Buzz"
  16.                     Case 2
  17.                         Label4.Text = "Chadd"
  18.                     Case 3
  19.                         Label4.Text = "Mark"
  20.                     Case 4
  21.                         Label4.Text = "Joe"
  22.  
  23.  
  24.                 End Select
  25.  
  26.             ElseIf RadioButton2.Checked = True And RadioButton1.Checked = False Then
  27.  
  28.                 Select Case num_al
  29.                     Case 0
  30.                         Label4.Text = "Alisson"
  31.                     Case 1
  32.                         Label4.Text = "Luz"
  33.                     Case 2
  34.                         Label4.Text = "Karen"
  35.                     Case 3
  36.                         Label4.Text = "Lilliam"
  37.                     Case 4
  38.                         Label4.Text = "Andrea"
  39.  
  40.                 End Select
  41.  
the bad thing of the way I did it. is that is not random at all, lol, sometimes i have to click up to 10 times to get a different numbers,
any ideas, or help would be appreciated
PS had to delete a lot of code
Feb 1 '11 #1
0 954

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

Similar topics

5
by: powerrun | last post by:
Help! I have tons of info loaded into an excel spreadsheet that I need to transfer into an existing database in access. There is a specific Query I need the information to transfer to. This...
0
by: Madhanmohan S | last post by:
Hi, How to search for the specific version of MS Access In Target Machine using .NET Deployment Launch Condition? Thanks And Regards Madhanmohan.S
0
by: mg | last post by:
Is it possible to "extract" the error messages from the ValidationSummary in a WebForm. I'd like to use these strings elsewhere. If so, is there a code example of this?
4
by: gugu | last post by:
Hi I have a datagrid which has 20 rows and 20 columns, 15 of 20 columns are checkboxs and their headertexts, datafields are dynamic. I need to loop through the whole page to see if the specific...
14
by: John T Ingato | last post by:
I have a contacts table with name address and such but are missing all phone numbers in the phone number fields. I have just received an updated customer list in Excel and have imported into a new...
1
by: dangier | last post by:
I have an Access 2003 table with an XML field that is tagged as follows: <Calendar CompactMode="1"><CustomProperties><CustomProperty Name="startdate" Value="3/26/2007"...
4
by: kaisersose1995 | last post by:
Hi, I'm trying to get Novell Netware information using vba into my access database and have no idea how to progress. Basically when i right click the properties on my computer the free space of a...
4
by: Farooqui | last post by:
Hi, I need help in writing a VB6 program to read 1000 word documents and extract my required information into a .dbf file. All word documents are having different information in a tabular form...
2
by: HTCAthenaGuy | last post by:
Hey ive got a simple problem here im using Forum.Document.Links to extract all links from a webpage loaded into a webbrowser control . Some of the links contain url variables like the subscribe...
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: 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
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,...
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,...

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.