Hi,
I have database with two forms(Login form & Info form) and a table. When I login with a user name , it has to open the "Info form" with the corresponding username's record. Please help me to fix this. Below this the code what I have now. Thank you - 'Open "Info_form" and pass the User_Name in OpenArgs parameter
-
DoCmd.OpenForm "Info_form", , , , , , Me.User_name
-
Forms("Info_Form").Button1.Visible = (Me.User_name = "Admin")
-
DoCmd.Close acForm, Me.Name
5 2415
You are opening the form and passing the username. But you are not opening the recordset of the paricular user in the form and also not passing the values. I think this might be the point!
Hi malathi,
yes . what I have rite now is this. How and where to include the code to open the corresponding recordset.
Try this: - DoCmd.OpenForm "Info_form", , , "UserName = " & Me.User_name, , , Me.User_name
If don't work, post the implied tables structures.
PS:
Edit your preview post (click Edit button)
Select this text: 'Open "Info_form" and pass the User_Name in OpenArgs parameter
DoCmd.OpenForm "Info_form", , , , , , Me.User_name
Forms("Info_Form").Button1.Visible = (Me.User_name = "Admin")
DoCmd.Close acForm, Me.Name
Click the <CODE/> button, in order to appear like this: - 'Open "Info_form" and pass the User_Name in OpenArgs parameter
-
DoCmd.OpenForm "Info_form", , , , , , Me.User_name
-
Forms("Info_Form").Button1.Visible = (Me.User_name = "Admin")
-
DoCmd.Close acForm, Me.Name
Do that from now when you post code !
Cheers !
Hi Mihail,
This is not workin. let me show you some other code.I have a drop down in the Infoform for admin,where he can view all the users through a drop down.I want something similar like this when a user login it should show their form.
User_ID = Me.NName.Value
DoCmd.SearchForRecord , "", acFirst, "[User ID] = " & "'" & Screen.ActiveControl & "'"
so the username comes from "User ID" and when the form opened by a user , it shold show up only his own record.
Please help me on this
Sign in to post your reply or Sign up for a free account.
Similar topics
by: allyn44 |
last post by:
Hello,
I have built a serch form for users to edit records. I only want them
to pull up the record they need, and I want to check for nulls. There
should not be dupes becasue the underlying...
|
by: kev |
last post by:
Hi folks,
I have a form for registration (frmRegistration) whereby i have two
buttons. One is Save which saves record using the OnClick property. I
used wizard to create the save button. The...
|
by: keri |
last post by:
Hi,
Simple version of the question.....
How do I use the where clause of the open form command to show an
account with a matching ID to be displayed when the form is opened?
Eg. I select a...
|
by: Beatrice |
last post by:
I need to open a form selecting all data from a previous form i.e:
Form 1)
combo box 1 named "cboYearSelect" displayed as "Year" based on qry QryYearList ( only one field "Year")
...
|
by: billa856 |
last post by:
Hi,
My project is in MS Access 2002.
In that I want to open one form multiple times.
I put one button on my main form.
Now whenever I click on that button than form will be open.
Now when I...
|
by: Mtek |
last post by:
Hi,
We have a combo box on our page, which gets populated via a MySQL
Query in PHP.
What we want to do is to print the values on the page in a table that
correspond the to selection from the...
|
by: ebasshead |
last post by:
Hi Everybody,
Behind a combo box on an open form, I have the below code to run a query, which it does, and pops up the query results.. MaxofID, NPPricePerWeek and IDProperty2, in data sheet view. ...
|
by: Emily Walshaw |
last post by:
I'm sorry, I know this has been asked a million times, but am completely new to access and need idiot proof help. I have a database and I am struggling to get a field to update based on a combobox...
|
by: Moorthi chinna |
last post by:
how to reload combobox in datagridview based on combobox selection in datagridview?
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |