informative Messagebox!

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a field that a employee enters an item. and another field that the
employee enters the user of that item....
What I would to see is when a user enter enters an item, a popup will appear
and inform the user that there are several users of that item and list the
users e.g., if the employee enters printer xyz the following will appear!

printer xyz has 4 users
user1's name
user2's name
user3's name
user4's name
 
Try this code

Dim MyDb as Dao.Database, MyRec as Dao.Recordset, MyStr as String
Set MyDb = currentdb
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '"
Me.Item & "'")
If not MyRec.Eof then
Myrec.MoveLast
MyStr = Me.Item & " Has " & MyRec.RecordCount & " Users"
MyRec.movefirst
While Not MyRec.Eof
MyStr = MyStr & vbCrLf
MyStr = MyStr & MyRec.[User_Name]
MyRec.MoveNext
Wend
End If

I didn't try the code, so you might get an erorr, also change the fields and
table name according to your data
This code need to be on the after update event of the Item field
 
I forgot to put the message box before the End if

MsgBox MyStr


--
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


Ofer said:
Try this code

Dim MyDb as Dao.Database, MyRec as Dao.Recordset, MyStr as String
Set MyDb = currentdb
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '"
Me.Item & "'")
If not MyRec.Eof then
Myrec.MoveLast
MyStr = Me.Item & " Has " & MyRec.RecordCount & " Users"
MyRec.movefirst
While Not MyRec.Eof
MyStr = MyStr & vbCrLf
MyStr = MyStr & MyRec.[User_Name]
MyRec.MoveNext
Wend
End If

I didn't try the code, so you might get an erorr, also change the fields and
table name according to your data
This code need to be on the after update event of the Item field

--
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:
I have a field that a employee enters an item. and another field that the
employee enters the user of that item....
What I would to see is when a user enter enters an item, a popup will appear
and inform the user that there are several users of that item and list the
users e.g., if the employee enters printer xyz the following will appear!

printer xyz has 4 users
user1's name
user2's name
user3's name
user4's name
 
I have tried it but am having an error in the following line
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '"
Me.Item & "'")

its saying that I need a list separator or )





Ofer said:
Try this code

Dim MyDb as Dao.Database, MyRec as Dao.Recordset, MyStr as String
Set MyDb = currentdb
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '"
Me.Item & "'")
If not MyRec.Eof then
Myrec.MoveLast
MyStr = Me.Item & " Has " & MyRec.RecordCount & " Users"
MyRec.movefirst
While Not MyRec.Eof
MyStr = MyStr & vbCrLf
MyStr = MyStr & MyRec.[User_Name]
MyRec.MoveNext
Wend
End If

I didn't try the code, so you might get an erorr, also change the fields and
table name according to your data
This code need to be on the after update event of the Item field

--
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:
I have a field that a employee enters an item. and another field that the
employee enters the user of that item....
What I would to see is when a user enter enters an item, a popup will appear
and inform the user that there are several users of that item and list the
users e.g., if the employee enters printer xyz the following will appear!

printer xyz has 4 users
user1's name
user2's name
user3's name
user4's name
 
Did you change the names
TableName = The table name where the data is stored
Item = the name of the Item Field

It also seem that I forgot a & before the Me.Item

Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '" &
Me.Item & "'")

--
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:
I have tried it but am having an error in the following line
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '"
Me.Item & "'")

its saying that I need a list separator or )





Ofer said:
Try this code

Dim MyDb as Dao.Database, MyRec as Dao.Recordset, MyStr as String
Set MyDb = currentdb
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '"
Me.Item & "'")
If not MyRec.Eof then
Myrec.MoveLast
MyStr = Me.Item & " Has " & MyRec.RecordCount & " Users"
MyRec.movefirst
While Not MyRec.Eof
MyStr = MyStr & vbCrLf
MyStr = MyStr & MyRec.[User_Name]
MyRec.MoveNext
Wend
End If

I didn't try the code, so you might get an erorr, also change the fields and
table name according to your data
This code need to be on the after update event of the Item field

--
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:
I have a field that a employee enters an item. and another field that the
employee enters the user of that item....
What I would to see is when a user enter enters an item, a popup will appear
and inform the user that there are several users of that item and list the
users e.g., if the employee enters printer xyz the following will appear!

printer xyz has 4 users
user1's name
user2's name
user3's name
user4's name
 
Ok that did the trick, but another error came up,
method or data member not found on the following line

MyStr = MyStr & MyRec.[User_Name]



Ofer said:
Did you change the names
TableName = The table name where the data is stored
Item = the name of the Item Field

It also seem that I forgot a & before the Me.Item

Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '" &
Me.Item & "'")

--
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:
I have tried it but am having an error in the following line
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '"
Me.Item & "'")

its saying that I need a list separator or )





Ofer said:
Try this code

Dim MyDb as Dao.Database, MyRec as Dao.Recordset, MyStr as String
Set MyDb = currentdb
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '"
Me.Item & "'")
If not MyRec.Eof then
Myrec.MoveLast
MyStr = Me.Item & " Has " & MyRec.RecordCount & " Users"
MyRec.movefirst
While Not MyRec.Eof
MyStr = MyStr & vbCrLf
MyStr = MyStr & MyRec.[User_Name]
MyRec.MoveNext
Wend
End If

I didn't try the code, so you might get an erorr, also change the fields and
table name according to your data
This code need to be on the after update event of the Item field

--
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 field that a employee enters an item. and another field that the
employee enters the user of that item....
What I would to see is when a user enter enters an item, a popup will appear
and inform the user that there are several users of that item and list the
users e.g., if the employee enters printer xyz the following will appear!

printer xyz has 4 users
user1's name
user2's name
user3's name
user4's name
 
Sorry, my mistake

change it to
MyRec![User_Name]

instead of a dot

--
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:
Ok that did the trick, but another error came up,
method or data member not found on the following line

MyStr = MyStr & MyRec.[User_Name]



Ofer said:
Did you change the names
TableName = The table name where the data is stored
Item = the name of the Item Field

It also seem that I forgot a & before the Me.Item

Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '" &
Me.Item & "'")

--
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:
I have tried it but am having an error in the following line
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '"
Me.Item & "'")

its saying that I need a list separator or )





:

Try this code

Dim MyDb as Dao.Database, MyRec as Dao.Recordset, MyStr as String
Set MyDb = currentdb
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '"
Me.Item & "'")
If not MyRec.Eof then
Myrec.MoveLast
MyStr = Me.Item & " Has " & MyRec.RecordCount & " Users"
MyRec.movefirst
While Not MyRec.Eof
MyStr = MyStr & vbCrLf
MyStr = MyStr & MyRec.[User_Name]
MyRec.MoveNext
Wend
End If

I didn't try the code, so you might get an erorr, also change the fields and
table name according to your data
This code need to be on the after update event of the Item field

--
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 field that a employee enters an item. and another field that the
employee enters the user of that item....
What I would to see is when a user enter enters an item, a popup will appear
and inform the user that there are several users of that item and list the
users e.g., if the employee enters printer xyz the following will appear!

printer xyz has 4 users
user1's name
user2's name
user3's name
user4's name
 
ok, that did the trick but another error came up run time error 3131 Syntax
error in from clause
in the following line!
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '" &
me.Item & "'")

Ofer said:
Sorry, my mistake

change it to
MyRec![User_Name]

instead of a dot

--
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:
Ok that did the trick, but another error came up,
method or data member not found on the following line

MyStr = MyStr & MyRec.[User_Name]



Ofer said:
Did you change the names
TableName = The table name where the data is stored
Item = the name of the Item Field

It also seem that I forgot a & before the Me.Item

Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '" &
Me.Item & "'")

--
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 tried it but am having an error in the following line
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '"
Me.Item & "'")

its saying that I need a list separator or )





:

Try this code

Dim MyDb as Dao.Database, MyRec as Dao.Recordset, MyStr as String
Set MyDb = currentdb
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '"
Me.Item & "'")
If not MyRec.Eof then
Myrec.MoveLast
MyStr = Me.Item & " Has " & MyRec.RecordCount & " Users"
MyRec.movefirst
While Not MyRec.Eof
MyStr = MyStr & vbCrLf
MyStr = MyStr & MyRec.[User_Name]
MyRec.MoveNext
Wend
End If

I didn't try the code, so you might get an erorr, also change the fields and
table name according to your data
This code need to be on the after update event of the Item field

--
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 field that a employee enters an item. and another field that the
employee enters the user of that item....
What I would to see is when a user enter enters an item, a popup will appear
and inform the user that there are several users of that item and list the
users e.g., if the employee enters printer xyz the following will appear!

printer xyz has 4 users
user1's name
user2's name
user3's name
user4's name
 
Can you post the full code that you are using, and not the one I posted?


--
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:
ok, that did the trick but another error came up run time error 3131 Syntax
error in from clause
in the following line!
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '" &
me.Item & "'")

Ofer said:
Sorry, my mistake

change it to
MyRec![User_Name]

instead of a dot

--
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:
Ok that did the trick, but another error came up,
method or data member not found on the following line

MyStr = MyStr & MyRec.[User_Name]



:

Did you change the names
TableName = The table name where the data is stored
Item = the name of the Item Field

It also seem that I forgot a & before the Me.Item

Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '" &
Me.Item & "'")

--
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 tried it but am having an error in the following line
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '"
Me.Item & "'")

its saying that I need a list separator or )





:

Try this code

Dim MyDb as Dao.Database, MyRec as Dao.Recordset, MyStr as String
Set MyDb = currentdb
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '"
Me.Item & "'")
If not MyRec.Eof then
Myrec.MoveLast
MyStr = Me.Item & " Has " & MyRec.RecordCount & " Users"
MyRec.movefirst
While Not MyRec.Eof
MyStr = MyStr & vbCrLf
MyStr = MyStr & MyRec.[User_Name]
MyRec.MoveNext
Wend
End If

I didn't try the code, so you might get an erorr, also change the fields and
table name according to your data
This code need to be on the after update event of the Item field

--
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 field that a employee enters an item. and another field that the
employee enters the user of that item....
What I would to see is when a user enter enters an item, a popup will appear
and inform the user that there are several users of that item and list the
users e.g., if the employee enters printer xyz the following will appear!

printer xyz has 4 users
user1's name
user2's name
user3's name
user4's name
 
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]
MyRec.MoveNext
Wend
MsgBox MyStr
End If
End Sub


Ofer said:
Can you post the full code that you are using, and not the one I posted?


--
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:
ok, that did the trick but another error came up run time error 3131 Syntax
error in from clause
in the following line!
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '" &
me.Item & "'")

Ofer said:
Sorry, my mistake

change it to
MyRec![User_Name]

instead of a dot

--
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


:

Ok that did the trick, but another error came up,
method or data member not found on the following line

MyStr = MyStr & MyRec.[User_Name]



:

Did you change the names
TableName = The table name where the data is stored
Item = the name of the Item Field

It also seem that I forgot a & before the Me.Item

Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '" &
Me.Item & "'")

--
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 tried it but am having an error in the following line
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '"
Me.Item & "'")

its saying that I need a list separator or )





:

Try this code

Dim MyDb as Dao.Database, MyRec as Dao.Recordset, MyStr as String
Set MyDb = currentdb
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '"
Me.Item & "'")
If not MyRec.Eof then
Myrec.MoveLast
MyStr = Me.Item & " Has " & MyRec.RecordCount & " Users"
MyRec.movefirst
While Not MyRec.Eof
MyStr = MyStr & vbCrLf
MyStr = MyStr & MyRec.[User_Name]
MyRec.MoveNext
Wend
End If

I didn't try the code, so you might get an erorr, also change the fields and
table name according to your data
This code need to be on the after update event of the Item field

--
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 field that a employee enters an item. and another field that the
employee enters the user of that item....
What I would to see is when a user enter enters an item, a popup will appear
and inform the user that there are several users of that item and list the
users e.g., if the employee enters printer xyz the following will appear!

printer xyz has 4 users
user1's name
user2's name
user3's name
user4's name
 
When the table name or the field name contain two words you need to put it in
square brackets

Set MyRec = MyDb.OpenRecordset("Select * From [Information Tracking] Where
ItemDescNo_ = '" & Me.ItemDescNo_ & "'")

--
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]
MyRec.MoveNext
Wend
MsgBox MyStr
End If
End Sub


Ofer said:
Can you post the full code that you are using, and not the one I posted?


--
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:
ok, that did the trick but another error came up run time error 3131 Syntax
error in from clause
in the following line!
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '" &
me.Item & "'")

:

Sorry, my mistake

change it to
MyRec![User_Name]

instead of a dot

--
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


:

Ok that did the trick, but another error came up,
method or data member not found on the following line

MyStr = MyStr & MyRec.[User_Name]



:

Did you change the names
TableName = The table name where the data is stored
Item = the name of the Item Field

It also seem that I forgot a & before the Me.Item

Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '" &
Me.Item & "'")

--
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 tried it but am having an error in the following line
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '"
Me.Item & "'")

its saying that I need a list separator or )





:

Try this code

Dim MyDb as Dao.Database, MyRec as Dao.Recordset, MyStr as String
Set MyDb = currentdb
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '"
Me.Item & "'")
If not MyRec.Eof then
Myrec.MoveLast
MyStr = Me.Item & " Has " & MyRec.RecordCount & " Users"
MyRec.movefirst
While Not MyRec.Eof
MyStr = MyStr & vbCrLf
MyStr = MyStr & MyRec.[User_Name]
MyRec.MoveNext
Wend
End If

I didn't try the code, so you might get an erorr, also change the fields and
table name according to your data
This code need to be on the after update event of the Item field

--
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 field that a employee enters an item. and another field that the
employee enters the user of that item....
What I would to see is when a user enter enters an item, a popup will appear
and inform the user that there are several users of that item and list the
users e.g., if the employee enters printer xyz the following will appear!

printer xyz has 4 users
user1's name
user2's name
user3's name
user4's name
 
ok, another error came up on the same line Run-time error'3061': Too few
parameters. expected 1.


Ofer said:
When the table name or the field name contain two words you need to put it in
square brackets

Set MyRec = MyDb.OpenRecordset("Select * From [Information Tracking] Where
ItemDescNo_ = '" & Me.ItemDescNo_ & "'")

--
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]
MyRec.MoveNext
Wend
MsgBox MyStr
End If
End Sub


Ofer said:
Can you post the full code that you are using, and not the one I posted?


--
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


:

ok, that did the trick but another error came up run time error 3131 Syntax
error in from clause
in the following line!
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '" &
me.Item & "'")

:

Sorry, my mistake

change it to
MyRec![User_Name]

instead of a dot

--
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


:

Ok that did the trick, but another error came up,
method or data member not found on the following line

MyStr = MyStr & MyRec.[User_Name]



:

Did you change the names
TableName = The table name where the data is stored
Item = the name of the Item Field

It also seem that I forgot a & before the Me.Item

Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '" &
Me.Item & "'")

--
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 tried it but am having an error in the following line
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '"
Me.Item & "'")

its saying that I need a list separator or )





:

Try this code

Dim MyDb as Dao.Database, MyRec as Dao.Recordset, MyStr as String
Set MyDb = currentdb
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '"
Me.Item & "'")
If not MyRec.Eof then
Myrec.MoveLast
MyStr = Me.Item & " Has " & MyRec.RecordCount & " Users"
MyRec.movefirst
While Not MyRec.Eof
MyStr = MyStr & vbCrLf
MyStr = MyStr & MyRec.[User_Name]
MyRec.MoveNext
Wend
End If

I didn't try the code, so you might get an erorr, also change the fields and
table name according to your data
This code need to be on the after update event of the Item field

--
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 field that a employee enters an item. and another field that the
employee enters the user of that item....
What I would to see is when a user enter enters an item, a popup will appear
and inform the user that there are several users of that item and list the
users e.g., if the employee enters printer xyz the following will appear!

printer xyz has 4 users
user1's name
user2's name
user3's name
user4's name
 
You can get this error message if the field name,ItemDescNo_, in the table is
wrong


--
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:
ok, another error came up on the same line Run-time error'3061': Too few
parameters. expected 1.


Ofer said:
When the table name or the field name contain two words you need to put it in
square brackets

Set MyRec = MyDb.OpenRecordset("Select * From [Information Tracking] Where
ItemDescNo_ = '" & Me.ItemDescNo_ & "'")

--
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]
MyRec.MoveNext
Wend
MsgBox MyStr
End If
End Sub


:

Can you post the full code that you are using, and not the one I posted?


--
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


:

ok, that did the trick but another error came up run time error 3131 Syntax
error in from clause
in the following line!
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '" &
me.Item & "'")

:

Sorry, my mistake

change it to
MyRec![User_Name]

instead of a dot

--
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


:

Ok that did the trick, but another error came up,
method or data member not found on the following line

MyStr = MyStr & MyRec.[User_Name]



:

Did you change the names
TableName = The table name where the data is stored
Item = the name of the Item Field

It also seem that I forgot a & before the Me.Item

Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '" &
Me.Item & "'")

--
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 tried it but am having an error in the following line
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '"
Me.Item & "'")

its saying that I need a list separator or )





:

Try this code

Dim MyDb as Dao.Database, MyRec as Dao.Recordset, MyStr as String
Set MyDb = currentdb
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '"
Me.Item & "'")
If not MyRec.Eof then
Myrec.MoveLast
MyStr = Me.Item & " Has " & MyRec.RecordCount & " Users"
MyRec.movefirst
While Not MyRec.Eof
MyStr = MyStr & vbCrLf
MyStr = MyStr & MyRec.[User_Name]
MyRec.MoveNext
Wend
End If

I didn't try the code, so you might get an erorr, also change the fields and
table name according to your data
This code need to be on the after update event of the Item field

--
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 field that a employee enters an item. and another field that the
employee enters the user of that item....
What I would to see is when a user enter enters an item, a popup will appear
and inform the user that there are several users of that item and list the
users e.g., if the employee enters printer xyz the following will appear!

printer xyz has 4 users
user1's name
user2's name
user3's name
user4's name
 
this is how its in my table ItemDescNo#, so when I change the _ to # I get an
error in the 2 part of the SQl saying that ItemDescNo# is not defined so I
have to change it to _ if I change the first part of the sql to have # it
gives me an error:
: Run-time error 3075:
systax error in date in query expression 'ItemDescNo# =' 1212121212"

.................................................
You can get this error message if the field name,ItemDescNo_, in the table is
wrong


--
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:
ok, another error came up on the same line Run-time error'3061': Too few
parameters. expected 1.


Ofer said:
When the table name or the field name contain two words you need to put it in
square brackets

Set MyRec = MyDb.OpenRecordset("Select * From [Information Tracking] Where
ItemDescNo_ = '" & Me.ItemDescNo_ & "'")

--
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


:

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]
MyRec.MoveNext
Wend
MsgBox MyStr
End If
End Sub


:

Can you post the full code that you are using, and not the one I posted?


--
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


:

ok, that did the trick but another error came up run time error 3131 Syntax
error in from clause
in the following line!
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '" &
me.Item & "'")

:

Sorry, my mistake

change it to
MyRec![User_Name]

instead of a dot

--
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


:

Ok that did the trick, but another error came up,
method or data member not found on the following line

MyStr = MyStr & MyRec.[User_Name]



:

Did you change the names
TableName = The table name where the data is stored
Item = the name of the Item Field

It also seem that I forgot a & before the Me.Item

Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '" &
Me.Item & "'")

--
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 tried it but am having an error in the following line
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '"
Me.Item & "'")

its saying that I need a list separator or )





:

Try this code

Dim MyDb as Dao.Database, MyRec as Dao.Recordset, MyStr as String
Set MyDb = currentdb
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '"
Me.Item & "'")
If not MyRec.Eof then
Myrec.MoveLast
MyStr = Me.Item & " Has " & MyRec.RecordCount & " Users"
MyRec.movefirst
While Not MyRec.Eof
MyStr = MyStr & vbCrLf
MyStr = MyStr & MyRec.[User_Name]
MyRec.MoveNext
Wend
End If

I didn't try the code, so you might get an erorr, also change the fields and
table name according to your data
This code need to be on the after update event of the Item field

--
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 field that a employee enters an item. and another field that the
employee enters the user of that item....
What I would to see is when a user enter enters an item, a popup will appear
and inform the user that there are several users of that item and list the
users e.g., if the employee enters printer xyz the following will appear!

printer xyz has 4 users
user1's name
user2's name
user3's name
user4's name
 
This name also need to be in square brackets

[ItemDescNo#] if that the name of the field in the table



JOM said:
this is how its in my table ItemDescNo#, so when I change the _ to # I get an
error in the 2 part of the SQl saying that ItemDescNo# is not defined so I
have to change it to _ if I change the first part of the sql to have # it
gives me an error:
: Run-time error 3075:
systax error in date in query expression 'ItemDescNo# =' 1212121212"

................................................
You can get this error message if the field name,ItemDescNo_, in the table is
wrong


--
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:
ok, another error came up on the same line Run-time error'3061': Too few
parameters. expected 1.


:

When the table name or the field name contain two words you need to put it in
square brackets

Set MyRec = MyDb.OpenRecordset("Select * From [Information Tracking] Where
ItemDescNo_ = '" & Me.ItemDescNo_ & "'")

--
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


:

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]
MyRec.MoveNext
Wend
MsgBox MyStr
End If
End Sub


:

Can you post the full code that you are using, and not the one I posted?


--
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


:

ok, that did the trick but another error came up run time error 3131 Syntax
error in from clause
in the following line!
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '" &
me.Item & "'")

:

Sorry, my mistake

change it to
MyRec![User_Name]

instead of a dot

--
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


:

Ok that did the trick, but another error came up,
method or data member not found on the following line

MyStr = MyStr & MyRec.[User_Name]



:

Did you change the names
TableName = The table name where the data is stored
Item = the name of the Item Field

It also seem that I forgot a & before the Me.Item

Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '" &
Me.Item & "'")

--
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 tried it but am having an error in the following line
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '"
Me.Item & "'")

its saying that I need a list separator or )





:

Try this code

Dim MyDb as Dao.Database, MyRec as Dao.Recordset, MyStr as String
Set MyDb = currentdb
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '"
Me.Item & "'")
If not MyRec.Eof then
Myrec.MoveLast
MyStr = Me.Item & " Has " & MyRec.RecordCount & " Users"
MyRec.movefirst
While Not MyRec.Eof
MyStr = MyStr & vbCrLf
MyStr = MyStr & MyRec.[User_Name]
MyRec.MoveNext
Wend
End If

I didn't try the code, so you might get an erorr, also change the fields and
table name according to your data
This code need to be on the after update event of the Item field

--
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 field that a employee enters an item. and another field that the
employee enters the user of that item....
What I would to see is when a user enter enters an item, a popup will appear
and inform the user that there are several users of that item and list the
users e.g., if the employee enters printer xyz the following will appear!

printer xyz has 4 users
user1's name
user2's name
user3's name
user4's name
 
I think that took care of the erros, but the popoup did not appear... did I
happen to put the msgbox in the wrong place? I put it after Wend

Ofer said:
This name also need to be in square brackets

[ItemDescNo#] if that the name of the field in the table



JOM said:
this is how its in my table ItemDescNo#, so when I change the _ to # I get an
error in the 2 part of the SQl saying that ItemDescNo# is not defined so I
have to change it to _ if I change the first part of the sql to have # it
gives me an error:
: Run-time error 3075:
systax error in date in query expression 'ItemDescNo# =' 1212121212"

................................................
You can get this error message if the field name,ItemDescNo_, in the table is
wrong


--
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


:

ok, another error came up on the same line Run-time error'3061': Too few
parameters. expected 1.


:

When the table name or the field name contain two words you need to put it in
square brackets

Set MyRec = MyDb.OpenRecordset("Select * From [Information Tracking] Where
ItemDescNo_ = '" & Me.ItemDescNo_ & "'")

--
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


:

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]
MyRec.MoveNext
Wend
MsgBox MyStr
End If
End Sub


:

Can you post the full code that you are using, and not the one I posted?


--
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


:

ok, that did the trick but another error came up run time error 3131 Syntax
error in from clause
in the following line!
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '" &
me.Item & "'")

:

Sorry, my mistake

change it to
MyRec![User_Name]

instead of a dot

--
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


:

Ok that did the trick, but another error came up,
method or data member not found on the following line

MyStr = MyStr & MyRec.[User_Name]



:

Did you change the names
TableName = The table name where the data is stored
Item = the name of the Item Field

It also seem that I forgot a & before the Me.Item

Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '" &
Me.Item & "'")

--
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 tried it but am having an error in the following line
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '"
Me.Item & "'")

its saying that I need a list separator or )





:

Try this code

Dim MyDb as Dao.Database, MyRec as Dao.Recordset, MyStr as String
Set MyDb = currentdb
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '"
Me.Item & "'")
If not MyRec.Eof then
Myrec.MoveLast
MyStr = Me.Item & " Has " & MyRec.RecordCount & " Users"
MyRec.movefirst
While Not MyRec.Eof
MyStr = MyStr & vbCrLf
MyStr = MyStr & MyRec.[User_Name]
MyRec.MoveNext
Wend
End If

I didn't try the code, so you might get an erorr, also change the fields and
table name according to your data
This code need to be on the after update event of the Item field

--
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 field that a employee enters an item. and another field that the
employee enters the user of that item....
What I would to see is when a user enter enters an item, a popup will appear
and inform the user that there are several users of that item and list the
users e.g., if the employee enters printer xyz the following will appear!

printer xyz has 4 users
user1's name
user2's name
user3's name
user4's name
 
Did you enter an Item that does exist in the table? other wise you wont get
any message.
Put a code break in the OpenRecordset line, press F9, and step the code by
pressing F8 to see if the recordset return any records and it enter the loop


--
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:
I think that took care of the erros, but the popoup did not appear... did I
happen to put the msgbox in the wrong place? I put it after Wend

Ofer said:
This name also need to be in square brackets

[ItemDescNo#] if that the name of the field in the table



JOM said:
this is how its in my table ItemDescNo#, so when I change the _ to # I get an
error in the 2 part of the SQl saying that ItemDescNo# is not defined so I
have to change it to _ if I change the first part of the sql to have # it
gives me an error:
: Run-time error 3075:
systax error in date in query expression 'ItemDescNo# =' 1212121212"

................................................

You can get this error message if the field name,ItemDescNo_, in the table is
wrong


--
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


:

ok, another error came up on the same line Run-time error'3061': Too few
parameters. expected 1.


:

When the table name or the field name contain two words you need to put it in
square brackets

Set MyRec = MyDb.OpenRecordset("Select * From [Information Tracking] Where
ItemDescNo_ = '" & Me.ItemDescNo_ & "'")

--
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


:

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]
MyRec.MoveNext
Wend
MsgBox MyStr
End If
End Sub


:

Can you post the full code that you are using, and not the one I posted?


--
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


:

ok, that did the trick but another error came up run time error 3131 Syntax
error in from clause
in the following line!
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '" &
me.Item & "'")

:

Sorry, my mistake

change it to
MyRec![User_Name]

instead of a dot

--
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


:

Ok that did the trick, but another error came up,
method or data member not found on the following line

MyStr = MyStr & MyRec.[User_Name]



:

Did you change the names
TableName = The table name where the data is stored
Item = the name of the Item Field

It also seem that I forgot a & before the Me.Item

Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '" &
Me.Item & "'")

--
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 tried it but am having an error in the following line
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '"
Me.Item & "'")

its saying that I need a list separator or )





:

Try this code

Dim MyDb as Dao.Database, MyRec as Dao.Recordset, MyStr as String
Set MyDb = currentdb
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '"
Me.Item & "'")
If not MyRec.Eof then
Myrec.MoveLast
MyStr = Me.Item & " Has " & MyRec.RecordCount & " Users"
MyRec.movefirst
While Not MyRec.Eof
MyStr = MyStr & vbCrLf
MyStr = MyStr & MyRec.[User_Name]
MyRec.MoveNext
Wend
End If

I didn't try the code, so you might get an erorr, also change the fields and
table name according to your data
This code need to be on the after update event of the Item field

--
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 field that a employee enters an item. and another field that the
employee enters the user of that item....
What I would to see is when a user enter enters an item, a popup will appear
and inform the user that there are several users of that item and list the
users e.g., if the employee enters printer xyz the following will appear!

printer xyz has 4 users
user1's name
user2's name
user3's name
user4's name
 
did that, it only goes upto the first line: If Not MyRec.EOF Then
then end if. It takes time when in the Sql Statement before it goes to the
first line of the loop....

Ofer said:
Did you enter an Item that does exist in the table? other wise you wont get
any message.
Put a code break in the OpenRecordset line, press F9, and step the code by
pressing F8 to see if the recordset return any records and it enter the loop


--
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:
I think that took care of the erros, but the popoup did not appear... did I
happen to put the msgbox in the wrong place? I put it after Wend

Ofer said:
This name also need to be in square brackets

[ItemDescNo#] if that the name of the field in the table



:

this is how its in my table ItemDescNo#, so when I change the _ to # I get an
error in the 2 part of the SQl saying that ItemDescNo# is not defined so I
have to change it to _ if I change the first part of the sql to have # it
gives me an error:
: Run-time error 3075:
systax error in date in query expression 'ItemDescNo# =' 1212121212"

................................................

You can get this error message if the field name,ItemDescNo_, in the table is
wrong


--
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


:

ok, another error came up on the same line Run-time error'3061': Too few
parameters. expected 1.


:

When the table name or the field name contain two words you need to put it in
square brackets

Set MyRec = MyDb.OpenRecordset("Select * From [Information Tracking] Where
ItemDescNo_ = '" & Me.ItemDescNo_ & "'")

--
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


:

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]
MyRec.MoveNext
Wend
MsgBox MyStr
End If
End Sub


:

Can you post the full code that you are using, and not the one I posted?


--
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


:

ok, that did the trick but another error came up run time error 3131 Syntax
error in from clause
in the following line!
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '" &
me.Item & "'")

:

Sorry, my mistake

change it to
MyRec![User_Name]

instead of a dot

--
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


:

Ok that did the trick, but another error came up,
method or data member not found on the following line

MyStr = MyStr & MyRec.[User_Name]



:

Did you change the names
TableName = The table name where the data is stored
Item = the name of the Item Field

It also seem that I forgot a & before the Me.Item

Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '" &
Me.Item & "'")

--
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 tried it but am having an error in the following line
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '"
Me.Item & "'")

its saying that I need a list separator or )





:

Try this code

Dim MyDb as Dao.Database, MyRec as Dao.Recordset, MyStr as String
Set MyDb = currentdb
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '"
Me.Item & "'")
If not MyRec.Eof then
Myrec.MoveLast
MyStr = Me.Item & " Has " & MyRec.RecordCount & " Users"
MyRec.movefirst
While Not MyRec.Eof
MyStr = MyStr & vbCrLf
MyStr = MyStr & MyRec.[User_Name]
MyRec.MoveNext
Wend
End If

I didn't try the code, so you might get an erorr, also change the fields and
table name according to your data
This code need to be on the after update event of the Item field

--
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 field that a employee enters an item. and another field that the
employee enters the user of that item....
What I would to see is when a user enter enters an item, a popup will appear
and inform the user that there are several users of that item and list the
users e.g., if the employee enters printer xyz the following will appear!

printer xyz has 4 users
user1's name
user2's name
user3's name
user4's name
 
Plese post the full code you have now, and while in code break, copy the
select line
"Select * From ..... & "'"

Open The immidiate window, (ctrl + g) paste this line with a question mark
?"Select ,..... "

Press enter, the out come, copy and create a new query, and paste this SQL,
to see if it returns any record, if it doesn't check if you have the right
item name.
Check that you comparing the right fields.


--
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:
did that, it only goes upto the first line: If Not MyRec.EOF Then
then end if. It takes time when in the Sql Statement before it goes to the
first line of the loop....

Ofer said:
Did you enter an Item that does exist in the table? other wise you wont get
any message.
Put a code break in the OpenRecordset line, press F9, and step the code by
pressing F8 to see if the recordset return any records and it enter the loop


--
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:
I think that took care of the erros, but the popoup did not appear... did I
happen to put the msgbox in the wrong place? I put it after Wend

:

This name also need to be in square brackets

[ItemDescNo#] if that the name of the field in the table



:

this is how its in my table ItemDescNo#, so when I change the _ to # I get an
error in the 2 part of the SQl saying that ItemDescNo# is not defined so I
have to change it to _ if I change the first part of the sql to have # it
gives me an error:
: Run-time error 3075:
systax error in date in query expression 'ItemDescNo# =' 1212121212"

................................................

You can get this error message if the field name,ItemDescNo_, in the table is
wrong


--
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


:

ok, another error came up on the same line Run-time error'3061': Too few
parameters. expected 1.


:

When the table name or the field name contain two words you need to put it in
square brackets

Set MyRec = MyDb.OpenRecordset("Select * From [Information Tracking] Where
ItemDescNo_ = '" & Me.ItemDescNo_ & "'")

--
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


:

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]
MyRec.MoveNext
Wend
MsgBox MyStr
End If
End Sub


:

Can you post the full code that you are using, and not the one I posted?


--
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


:

ok, that did the trick but another error came up run time error 3131 Syntax
error in from clause
in the following line!
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '" &
me.Item & "'")

:

Sorry, my mistake

change it to
MyRec![User_Name]

instead of a dot

--
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


:

Ok that did the trick, but another error came up,
method or data member not found on the following line

MyStr = MyStr & MyRec.[User_Name]



:

Did you change the names
TableName = The table name where the data is stored
Item = the name of the Item Field

It also seem that I forgot a & before the Me.Item

Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '" &
Me.Item & "'")

--
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 tried it but am having an error in the following line
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '"
Me.Item & "'")

its saying that I need a list separator or )





:

Try this code

Dim MyDb as Dao.Database, MyRec as Dao.Recordset, MyStr as String
Set MyDb = currentdb
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '"
Me.Item & "'")
If not MyRec.Eof then
Myrec.MoveLast
MyStr = Me.Item & " Has " & MyRec.RecordCount & " Users"
MyRec.movefirst
While Not MyRec.Eof
MyStr = MyStr & vbCrLf
MyStr = MyStr & MyRec.[User_Name]
MyRec.MoveNext
Wend
End If

I didn't try the code, so you might get an erorr, also change the fields and
table name according to your data
This code need to be on the after update event of the Item field

--
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 field that a employee enters an item. and another field that the
employee enters the user of that item....
What I would to see is when a user enter enters an item, a popup will appear
and inform the user that there are several users of that item and list the
users e.g., if the employee enters printer xyz the following will appear!

printer xyz has 4 users
user1's name
user2's name
user3's name
user4's name
 
Thank you so much for your help, it actually worked, I have 2 tables that I
was using the wrong one...
thanks alot, the only thing its doing though it takes a long time when in
the SQL statement, my code is still the same... as I had posted earlier....

Ofer said:
Plese post the full code you have now, and while in code break, copy the
select line
"Select * From ..... & "'"

Open The immidiate window, (ctrl + g) paste this line with a question mark
?"Select ,..... "

Press enter, the out come, copy and create a new query, and paste this SQL,
to see if it returns any record, if it doesn't check if you have the right
item name.
Check that you comparing the right fields.


--
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:
did that, it only goes upto the first line: If Not MyRec.EOF Then
then end if. It takes time when in the Sql Statement before it goes to the
first line of the loop....

Ofer said:
Did you enter an Item that does exist in the table? other wise you wont get
any message.
Put a code break in the OpenRecordset line, press F9, and step the code by
pressing F8 to see if the recordset return any records and it enter the loop


--
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 think that took care of the erros, but the popoup did not appear... did I
happen to put the msgbox in the wrong place? I put it after Wend

:

This name also need to be in square brackets

[ItemDescNo#] if that the name of the field in the table



:

this is how its in my table ItemDescNo#, so when I change the _ to # I get an
error in the 2 part of the SQl saying that ItemDescNo# is not defined so I
have to change it to _ if I change the first part of the sql to have # it
gives me an error:
: Run-time error 3075:
systax error in date in query expression 'ItemDescNo# =' 1212121212"

................................................

You can get this error message if the field name,ItemDescNo_, in the table is
wrong


--
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


:

ok, another error came up on the same line Run-time error'3061': Too few
parameters. expected 1.


:

When the table name or the field name contain two words you need to put it in
square brackets

Set MyRec = MyDb.OpenRecordset("Select * From [Information Tracking] Where
ItemDescNo_ = '" & Me.ItemDescNo_ & "'")

--
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


:

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]
MyRec.MoveNext
Wend
MsgBox MyStr
End If
End Sub


:

Can you post the full code that you are using, and not the one I posted?


--
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


:

ok, that did the trick but another error came up run time error 3131 Syntax
error in from clause
in the following line!
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '" &
me.Item & "'")

:

Sorry, my mistake

change it to
MyRec![User_Name]

instead of a dot

--
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


:

Ok that did the trick, but another error came up,
method or data member not found on the following line

MyStr = MyStr & MyRec.[User_Name]



:

Did you change the names
TableName = The table name where the data is stored
Item = the name of the Item Field

It also seem that I forgot a & before the Me.Item

Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '" &
Me.Item & "'")

--
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 tried it but am having an error in the following line
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '"
Me.Item & "'")

its saying that I need a list separator or )





:

Try this code

Dim MyDb as Dao.Database, MyRec as Dao.Recordset, MyStr as String
Set MyDb = currentdb
Set MyRec = MyDb.OpenRecordset("Select * From TableName Where Item = '"
Me.Item & "'")
If not MyRec.Eof then
Myrec.MoveLast
MyStr = Me.Item & " Has " & MyRec.RecordCount & " Users"
MyRec.movefirst
While Not MyRec.Eof
MyStr = MyStr & vbCrLf
MyStr = MyStr & MyRec.[User_Name]
MyRec.MoveNext
Wend
End If

I didn't try the code, so you might get an erorr, also change the fields and
table name according to your data
This code need to be on the after update event of the Item field

--
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 field that a employee enters an item. and another field that the
employee enters the user of that item....
What I would to see is when a user enter enters an item, a popup will appear
and inform the user that there are several users of that item and list the
users e.g., if the employee enters printer xyz the following will appear!

printer xyz has 4 users
user1's name
user2's name
user3's name
user4's name
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top