Now I remember
Private Sub ItemDescNo__AfterUpdate()
Dim MyDb As Dao.Database, MyRec As Dao.Recordset, MyStr As String
Set MyDb = CurrentDb
' the table name need to have square brackets
Set MyRec = MyDb.OpenRecordset("Select * From [Information Tracking] Where
ItemDescNo_ = '" & Me.ItemDescNo_ & "'")
If Not MyRec.EOF Then
MyRec.MoveLast
MyStr = Me.ItemDescNo_ & " Has " & MyRec.RecordCount & " Users"
MyRec.MoveFirst
While Not MyRec.EOF
MyStr = MyStr & vbCrLf
MyStr = MyStr & MyRec![EmplName] & " Showing "
===========================================
' If you want the Customer name and not the Id then change this field,
CustomerID, with the field name that has the customer name in it, check the
table for that
MyStr = MyStr & MyRec![CustomerID]
============================================
MyRec.MoveNext
Wend
MsgBox MyStr
End If
End Sub
--
The next line is only relevant to Microsoft''s web-based interface users.
If I answered your question, please mark it as an answer. It''s useful to
know that my answer was helpful
HTH, good luck
JOM said:
Private Sub ItemDescNo__AfterUpdate()
Dim MyDb As Dao.Database, MyRec As Dao.Recordset, MyStr As String
Set MyDb = CurrentDb
Set MyRec = MyDb.OpenRecordset("Select * From Information Tracking Where
ItemDescNo_ = '" & Me.ItemDescNo_ & "'")
If Not MyRec.EOF Then
MyRec.MoveLast
MyStr = Me.ItemDescNo_ & " Has " & MyRec.RecordCount & " Users"
MyRec.MoveFirst
While Not MyRec.EOF
MyStr = MyStr & vbCrLf
MyStr = MyStr & MyRec![EmplName] & " Showing"
MyStr = MyStr & MyRec![CustomerID]
MyRec.MoveNext
Wend
MsgBox MyStr
End If
End Sub
***************************************************
:
Can you post the full code, with the message box that you have now, that
display the ID?
:
I think I have lost you, this is what is going on in continuation to a
previous reply that you helped me with the other day ie the informative
messagebox!.....
the following is the sql statement on my Form
Set MyRec = MyDb.OpenRecordset("Select * From [Information Tracking] Where
ItemDescNo_ = '" & Me.ItemDescNo_ & "'")
then the following is where I would like it to show the Name instead of the
ID!
MyStr = MyStr & MyRec![CustomerID]
:
You need to set the column number
Msgbox Me.[ComboName].column(1)
The column numbers start with 0 for the first column.
--
The next line is only relevant to Microsoft''s web-based interface users.
If I answered your question, please mark it as an answer. It''s useful to
know that my answer was helpful
HTH, good luck
:
I have a combobox on my form whose control ssource is from a foreign key ID
with the ID hidden and the name of the customer shows on the form. I want
the messagebox that will appear with the Name of customers, but its showing
the ID instead of the Name how will I take care of this?