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

Auto fill or populate a form

I'm trying to get a row of a List Box (13 columns) to auto fill into 5 List Boxes and 8 Text

Boxes on a form when clicked.

List Box Name: List 166
Row Source: SELECT [Battlefield Roster].UPC, [Battlefield Roster].PARA, [Battlefield

Roster].LINE, [Battlefield Roster].[POSITION TITLE], [Battlefield Roster].RANK, [Battlefield

Roster].Grade, [Battlefield Roster].DMOS, [Battlefield Roster].[ID CODE], [Battlefield Roster].

[ASI I], [Battlefield Roster].[ASI II], [Battlefield Roster].[ASI III], [Battlefield Roster].

[MTOE REQUIRED], [Battlefield Roster].AUTH FROM [Battlefield Roster] ORDER BY [UPC], [PARA],

[LINE];

To go into example
List Box Name: Position Title
Text Box Name: PARA

Thank you for any help,

Harry
Jan 23 '08 #1
6 2279
ADezii
8,834 Expert 8TB
I'm trying to get a row of a List Box (13 columns) to auto fill into 5 List Boxes and 8 Text

Boxes on a form when clicked.

List Box Name: List 166
Row Source: SELECT [Battlefield Roster].UPC, [Battlefield Roster].PARA, [Battlefield

Roster].LINE, [Battlefield Roster].[POSITION TITLE], [Battlefield Roster].RANK, [Battlefield

Roster].Grade, [Battlefield Roster].DMOS, [Battlefield Roster].[ID CODE], [Battlefield Roster].

[ASI I], [Battlefield Roster].[ASI II], [Battlefield Roster].[ASI III], [Battlefield Roster].

[MTOE REQUIRED], [Battlefield Roster].AUTH FROM [Battlefield Roster] ORDER BY [UPC], [PARA],

[LINE];

To go into example
List Box Name: Position Title
Text Box Name: PARA

Thank you for any help,

Harry
It would be somethink like this, in the List Box's Click() Event. Substitute your own Control Names:
Expand|Select|Wrap|Line Numbers
  1. Private Sub List_166_Click()
  2.   Me![lstUPC] = Me![List 166].Column(0)
  3.   Me![lstPARA] = Me![List 166].Column(1)
  4.   Me![lstLINE] =  Me![List 166].Column(2)
  5.   Me![lstPOSITION TITLE] = Me![List 166].Column(3)
  6.   Me![lstRANK] =  Me![List 166].Column(4)
  7.   Me![txtGRADE] = Me![List 166].Column(5)
  8.   Me![txtDMOS] = Me![List 166].Column(6)
  9.   Me![txtID CODE] = Me![List 166].Column(7)
  10.   Me![txtASI I] =  Me![List 166].Column(8)
  11.   Me![txtASI II] = Me![List 166].Column(9)
  12.   Me![txtASI III] = Me![List 166].Column(10)
  13.   Me![txtMTOE REQUIRED] = Me![List 166].Column(11)
  14.   Me![txtAUTH FROM] = Me![List 166].Column(12)
  15. End Sub
Jan 23 '08 #2
First off, THANKYOU!!! Worked good but...2 things I still have a problem with

Here is the code:

Private Sub List166_AfterUpdate()


Me![lstUPC] = Me![List166].Column(0)
Me![txtPARA] = Me![List166].Column(1)
Me![txtLine] = Me![List166].Column(2)
Me![lstPosition Title] = Me![List166].Column(3)
Me![lstRank] = Me![List166].Column(4)
Me![lstGrade] = Me![List166].Column(5)
Me![txtDMOS] = Me![List166].Column(6)
Me![lstID Code] = Me![List166].Column(7)
Me![txtASI I] = Me![List166].Column(8)
Me![txtASI II] = Me![List166].Column(9)
Me![txtASI III] = Me![List166].Column(10)
Me![txtMTOE Required] = Me![List166].Column(11)
Me![txtAUTH] = Me![List166].Column(12)
End Sub

First is the first one txtUPC, doesnt get changed,

And 2nd is when I click on a row in the List Box (List166) to be changed , the row I click doesnt stay highlighted, it'll hightlight the first on in a group of UPC, if I have A1, A2, A3, A4, A5 and I click 2, 3, 4 or 5 , 1 will hightlight.

Thank you again
Jan 23 '08 #3
ADezii
8,834 Expert 8TB
First off, THANKYOU!!! Worked good but...2 things I still have a problem with

Here is the code:

Private Sub List166_AfterUpdate()


Me![lstUPC] = Me![List166].Column(0)
Me![txtPARA] = Me![List166].Column(1)
Me![txtLine] = Me![List166].Column(2)
Me![lstPosition Title] = Me![List166].Column(3)
Me![lstRank] = Me![List166].Column(4)
Me![lstGrade] = Me![List166].Column(5)
Me![txtDMOS] = Me![List166].Column(6)
Me![lstID Code] = Me![List166].Column(7)
Me![txtASI I] = Me![List166].Column(8)
Me![txtASI II] = Me![List166].Column(9)
Me![txtASI III] = Me![List166].Column(10)
Me![txtMTOE Required] = Me![List166].Column(11)
Me![txtAUTH] = Me![List166].Column(12)
End Sub

First is the first one txtUPC, doesnt get changed,

And 2nd is when I click on a row in the List Box (List166) to be changed , the row I click doesnt stay highlighted, it'll hightlight the first on in a group of UPC, if I have A1, A2, A3, A4, A5 and I click 2, 3, 4 or 5 , 1 will hightlight.

Thank you again
First is the first one txtUPC, doesnt get changed,
Probably a typographical error on the Field Name.

And 2nd is when I click on a row in the List Box (List166) to be changed , the row I click doesn't stay highlighted, it'll hightlight the first on in a group of UPC, if I have A1, A2, A3, A4, A5 and I click 2, 3, 4 or 5 , 1 will hightlight.
Set the Multi Select Property of the List Box to Simple, then individual items that were selected will stay highlighted. If you need to de-select all the items at some point, I can show you how to do that.
Jan 23 '08 #4
Probably a typographical error on the Field Name.
Thank you highlight fixed.

Still having a problem with 2 boxes not getting filled, lst UPC and lstGrade. They all work but them 2.
Jan 23 '08 #5
ADezii
8,834 Expert 8TB
Thank you highlight fixed.

Still having a problem with 2 boxes not getting filled, lst UPC and lstGrade. They all work but them 2.
As long as they are properly identified and th proper Columns are referenced, I canot see why this would be happening. If you like, I'll send you my E-Mail address in a Private Message, and you can send me the Database as an Attachment. As soon as I get a chance, I would be more than happy to have a look at it, and hopefully solve the problem. Let me know either way.
Jan 23 '08 #6
As long as they are properly identified and th proper Columns are referenced, I canot see why this would be happening. If you like, I'll send you my E-Mail address in a Private Message, and you can send me the Database as an Attachment. As soon as I get a chance, I would be more than happy to have a look at it, and hopefully solve the problem. Let me know either way.
Absolutely that would be great.
Jan 23 '08 #7

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

Similar topics

2
by: C. David Rossen | last post by:
Hello: I have a registration form for classes. Each class has a fee. I have a drop down box whereby the user chooses his class. There is a textbox with the associated fee. I would like to...
1
by: ogilby1 | last post by:
Using an immediate if to fill a field on a form based on the value of another field. During data entry on the form this methodology works well. When looking at the results in the datasheet view or...
1
by: Jason Galvin | last post by:
I would like to disable the auto-populating feature (remembers form element text between post-backs) when creating a .NET form. I have succeeded in disabling auto-populate by creating my controls...
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...
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...
4
by: scolivas | last post by:
I think this is a me thing. but can't remember how to do it. I have a form that I am using and would like for a txt box to automatically populate based on what is selected in a combo box. here...
5
by: kalboako1987 | last post by:
hello guys Im trying to autopopulate my form from a table in my database called Enrollment.it will fill the textboxes in my form whenever the id number typed in the textbox is existing in my...
106
by: bonneylake | last post by:
Hey Everyone, Well i don't know if my question should be in javascript/ajax or coldfusion, i figure this is more of a coldfusion question. But if this is in the wrong section let me know an all...
2
by: paulyXvpf | last post by:
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,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
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...

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.