Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Afterupdate textboxes 1

Status
Not open for further replies.

BT24

Programmer
Aug 19, 2002
76
CA
Hello there

I have a little problem...I have a Combo box that has a list of employees in it and when a certain employee is chosen i would like the following two text boxes to update to show the licences that that employee holds. Thanks for the help!

BT24
 
Need more info BT24

What is the RowSource of the combo box ?

What is the RecordSource of the Form that this is on ?

What are the names of the two text box controls and of the combo box

What table is the Licence information stored in.

What is the Relationship between the Licence information table and the bound column of the combo box ?


Without that - no-one can help you very much.

G LS
 
Hello

The RowSource of the combo box is a row in a Query that has all the employees names.
The record source is a table called tblOICMain where everything is listed
the names are EmployeeName(comboBox), WaterTreatmentLevel(textbox) and WaterDistributionLevel(textbox)
the licence information is stored in a table called tblEmployeeTickets.
The relationship has not been developed because that is where i think i am having most of the problems

thanks for the help
BT24
 
Gosh BT24 - you really like keeping people guessing don't you.

By What is the RowSource / RecordSource, I meant what is the ACTUAL SQL Code. I was expecting
"SELECT ... FROM ... ON .. WHERE ... " in each case


Anyway - lets see how far we can get with a few guesses/recommendations

WaterTreatmentLevel and WaterDistributionLevel are UNBOUND? text boxes ?

The combo box ( Called cboPickEmp ) has 5 columns which are
EmployeeId
EmployeeFirstName
EmployeeSurname
WTLLicence
WDLLicence

Then in the comboBox's AfterUpdate event put the following code

Private Sub cboPickEmp()
WaterTreatmentLevel = cboPickEmp.Column(3)
WaterDistributionLevel = cboPickEmp.Column(4)
End Sub

Note Column(x) is a Zero based index.



'ope-that-'elps.

G LS
 
sorry about not giving you the right info. but i think that the information that you gave me will help. i have no sql statment so i guess thats why i didnt give you one. and the text boxes are bound to the table. thanks for all the help

BT24
 
Well hang on then.

If the text boxes are BOUND - is the combo box BOUND ?

If so then I think you are storing duplicate data - which you shouldn't be doing.

Check your schema carefully.

G LS
accessaceNOJUNK@valleyalley.co.uk
Remove the NOJUNK to use.

Please remember to give helpful posts the stars they deserve!
This makes the post more visible to others in need! :-D

 
Once again thanks for the help, olay the text boxes are no longer bound. but the Combo box is bound to a query. i dont know if that help. i am sorry for being so vague.

BT24
 
Lets see if i can give you more info. The form looks like this: The Fields are like this EmployeeName (combo box)bound to SELECT DISTINCTROW [qryEmployeeName].[Name] FROM [qryEmployeeName];
then there are two text boxes that are named WaterTreatmentLevel and WaterDistributionLevel respectively.
then there are two other text boxes one is OITTime for the amount of time that an employee is on-call. the last text box is the date. The date is there for Report purposes. the text boxes are all unbound the combo box is bound. The form is saved in a table called tblOICMain. i hope that this helps it all i can think of

BT24
 
Okay what i did is put all the information in the columns and it is working but it will not let me have a null value in the fields and some of the operators dont have certain levels. so now how do i make it accept having a null value?

Thanks for the help
BT24
 
Okay what i did is put all the information in the columns and it is working but it will not let me have a null value in the fields and some of the operators dont have certain levels. so now how do i make it accept having a null value?

Thanks for the help
BT24
 
The Fields are like this EmployeeName (combo box)bound to SELECT DISTINCTROW [qryEmployeeName].[Name] FROM [qryEmployeeName];

No, No, No

FIELDS are found in TABLES.
The things that you see on forms are CONTROLS

A combo box control is BOUND to a FIELD in a table via the fieldname in the CONTROL SOURCE property.

The SELECT statement that you have there is, I suspect, in the ROW SOURCE property.

The ROWSOURCE defines what data populates the dropdown list part of the combo box. It does NOT define what the combo box is BOUND to.



The form is saved in a table called tblOICMain

No, No, No

The FORM is saved in the DATABASE

The data that you see on the form may well be Saved in a table called tblOICMain.

However, if that is the case then what is qryEmployeeName doing ?
The use of qryEmployeeName inside the combo box ROW SOURCE seems a total waste of time.

SELECT DISTINCTROW [Name] FROM [tblOICMain];

would seem to do perfectly well.


G LS
accessaceNOJUNK@valleyalley.co.uk
Remove the NOJUNK to use.

Please remember to give helpful posts the stars they deserve!
This makes the post more visible to others in need! :-D

 
Thanks
The reason that i used the qryEmployeeName is because, the qry is bound to a Report for lookup purposes and it was just easier to use it then to make a new query and change all the setting on the Criteria Lookup form and the report. thats all. i thank you for your help but what do i do about having Null Values in the Columns?

BT24
 
Whether or not the table will allow you to have a NULL in a field is set up in the table design.

Make sure that the field in question has its REQUIRED property set to NO.


G LS
accessaceNOJUNK@valleyalley.co.uk
Remove the NOJUNK to use.

Please remember to give helpful posts the stars they deserve!
This makes the post more visible to others in need! :-D

 
Thanks again!! i should have known to look at that.

BT24
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top