Can
Printable View
Can
Morning Behemoth, im ok, and u? everything is fine this morning cept i have a little problem, i know i know this is chit chat but still...
when i select a value from a Combo box the value changes the contents of the combo box it self, i want the Selected value to stay in the combobox.text after it being selected but when the combobox contents change it changes another combo box and when that combo box changes it clear the combo.text value in the first to nothing????
the code is a little messy as ive been playing with it, i can upload the whole program if required but this will need a few extra controls.
ThanksCode:Private Sub cboCalDept_Change()
fraDetails.Caption = DETAIL_CAPTION & cboCalDept.Text
If DeptExists2() <> True Then Exit Sub
If cboCalDept = DEPT_CAPTION Then Exit Sub
Call FillCombo(cboCalDept, cboCalEmployee, False)
End Sub
Private Sub cboCalDept_Click()
Call cboCalDept_Change
End Sub
Private Sub cboCalEmployee_Change()
If EmployeeExists2() <> True Then Exit Sub
If cboCalDept = EMPLOYEE_CAPTION Then Exit Sub
Call FillCombo(cboCalDept, cboCalEmployee, True)
End Sub
Private Sub cboCalEmployee_Click()
Call cboCalEmployee_Change
End Sub
Sub FillCombo(sDept As String, sEmployee As String, bEmployeeSelected As Boolean)
Dim DB As Database
Dim RS As Recordset
Dim sSQL As String
Dim iCount As Integer
Dim X As Integer
Set DB = DAO.OpenDatabase(DBpath, False, False, ";pwd=" & DBpassword)
sSQL = "SELECT * FROM employee WHERE dept = '" & cboCalDept & "'"
Set RS = DB.OpenRecordset(sSQL)
Select Case bEmployeeSelected
Case True
Dim sLastEmployee
sLastEmployee = cboCalEmployee.Text
sSQL = "SELECT * FROM employee WHERE employee = '" & cboCalEmployee & "'"
Set RS = DB.OpenRecordset(sSQL)
cboCalDept.Text = RS!dept
cboCalEmployee.Text = sLastEmployee
Case False
cboCalEmployee.Clear
sSQL = "SELECT * FROM employee WHERE dept = '" & cboCalDept & "'"
Set RS = DB.OpenRecordset(sSQL)
RS.MoveLast
RS.MoveFirst
iCount = RS.RecordCount
Do Until X = iCount
cboCalEmployee.AddItem RS!employee
RS.MoveNext
X = X + 1
Loop
cboCalEmployee.Text = cboCalEmployee.List(0)
Case Else
MsgBox "Unexpected Error! Please contact your system administrator", vbExclamation, "Error"
End Select
End Sub
Simon
Dont worry i have it working now;)
Ive just got a new account manager at PCworld (its a bloody man arrrgghhh) and i got somit really dodgy attached to a email from him...let me know wat u think.
Good morning everyone!
hi babe. U ok?
Yep..thanks for asking. I got a little more sleep last night. My husband is staying home with my daughter today so at least I know she won't be alone.
How's your day so far?
you really dont want to know. Ive got to put this horrible ointment in my eye after yesterday. I've taken to calling it satan's snot (well actually something a little more tasteless that im not prepared to divulge in here). Im bored, tired and depressed. but lets not bring everybody else down...
I'm fine thank you...
Sorry to hear about the eye. Have you made up a good story about how it happened yet....you could get really creative.
it quite cool to tell people i had a chunk of metal removed (cos thats what it was - and it had started to rust!), but if you've got any cooler stories, let me know.
Hi all...
We got ANOTHER 9 inches of snow last night, and they said that the worst is to come tonight. I tried to get my son out to his daycare this morning, and had to turn around. When I got back on the main road, a semi-truck passed me in oncoming traffic and blew up so much snow and the truck behind the first truck almost ran into me head on because he couldn't see though the blowing snow. I amazingly found a backup daycare only about 15 blocks from where I work.
So, it's been quite an interesting morning for me.
(I'm exhausted already)
i always forget its only morning now for our cousins across the pond. hi anyway. its 3:40pm here. and im tired.
Were you climbing Everest in a blinding snow storm and hammering in a piton into a ledge and unbeknownst to you a shard of metal sheared off and was left in your eye? It was discovered just in the nick of time by a beautiful woman who was gazing deeply into your eyes in a moment of passion or you would have lost your sight. That would be pretty cool!
Good morning Shanea. Sounds like you should have stayed home with a fire and a nice big cup of coffee!
is that believable enough?
do i need more evidence? a beautiful woman perhaps>
I wish I could have stayed home, but they are starting testing on my project in 1 1/2 weeks and I have a lot left to do yet. If I stay home and dial in, I get distracted way to easily. The computer is in the activity room in the basement right next to the TV.
I'm sure there must be some beautiful woman around you that would cooroborate your story! Don't you think it's much more exciting than "I don't know how it got in there"?
here's a more surreal one.
I discovered yesterday that I am an android. The past 2 decades plus I have been living under the mistaken believe that I was organic like the rest of you. I now know that is not true. Not only am I a man made bi-product of the technological age, my structure is decaying. My optical organs are rusting, and I am preparing myself for recycling.
A sad, sad life...
I don't know if it's any more believable than mine but it is definitely cooler!!!!!!!!!!!! I'd stick with that one!
mind you, i could be a mountain-climbing dying android with a beautiful woman...
possibly a little over the top?
The story just keeps getting better!