CoffeeGuru
Registered User.
- Local time
- Today, 23:57
- Joined
- Jun 20, 2013
- Messages
- 121
I am having a problem, where when a user selects a user name from a dropdown box (cboEmployee) an After Update event occurs
DoCmd.RunMacro "user"
Me.txtPassword.SetFocus
The Macro "user" should do the following:
Open Query "Empty_User"
DELETE Current_User.User AS Expr1, Current_User.User
FROM [Current_User]
WHERE (((Current_User.User) Like "*"));
Open Query "Current_User"
PARAMETERS cboEmployee Short;
INSERT INTO [Current_User] ( [User] )
SELECT [cboEmployee] AS Expr1
FROM [Current_User];
Open Query "Current_User_2"
UPDATE (User_Data INNER JOIN [Current_User] ON User_Data.lngEmpID = Current_User.User) INNER JOIN tblCountry ON User_Data.strEmpName = tblCountry.Country SET [Current_User].UserName = [strEmpName], [Current_User].CountryCode = [Country Code];
The table Current_User does clear down but then I get a message box asking me to Enter a Parameter Value for "cboEmployee"
as cboEmployee is the name of the combobox I was under the impression that the contents of the combobox would be passed to the query.
I should probably state as this point that the tables are on SQL Server, if it makes any difference. If I press Cancel I get the following box
Macro Name: User
Condition:
Action Name: OpenQuery
Arguments: Current_User, Datasheet, Edit
Error Number: 3021
Can anyone know tell me what I missing here?
Update
I forgot to say that cboEmployee also has this Row Source:
SELECT User_Data.lngEmpID AS Expr1, User_Data.CountryCode, User_Data.strEmpName AS Expr2 FROM User_Data;
Row Source Type: Table/Query
DoCmd.RunMacro "user"
Me.txtPassword.SetFocus
The Macro "user" should do the following:
Open Query "Empty_User"
DELETE Current_User.User AS Expr1, Current_User.User
FROM [Current_User]
WHERE (((Current_User.User) Like "*"));
Open Query "Current_User"
PARAMETERS cboEmployee Short;
INSERT INTO [Current_User] ( [User] )
SELECT [cboEmployee] AS Expr1
FROM [Current_User];
Open Query "Current_User_2"
UPDATE (User_Data INNER JOIN [Current_User] ON User_Data.lngEmpID = Current_User.User) INNER JOIN tblCountry ON User_Data.strEmpName = tblCountry.Country SET [Current_User].UserName = [strEmpName], [Current_User].CountryCode = [Country Code];
The table Current_User does clear down but then I get a message box asking me to Enter a Parameter Value for "cboEmployee"
as cboEmployee is the name of the combobox I was under the impression that the contents of the combobox would be passed to the query.
I should probably state as this point that the tables are on SQL Server, if it makes any difference. If I press Cancel I get the following box
Macro Name: User
Condition:
Action Name: OpenQuery
Arguments: Current_User, Datasheet, Edit
Error Number: 3021
Can anyone know tell me what I missing here?
Update
I forgot to say that cboEmployee also has this Row Source:
SELECT User_Data.lngEmpID AS Expr1, User_Data.CountryCode, User_Data.strEmpName AS Expr2 FROM User_Data;
Row Source Type: Table/Query
Last edited: