Combo box from form1 to be the unchangeable value combo box in form2

Pusher

BEOGRAD Put
Local time
Today, 21:47
Joined
May 25, 2011
Messages
230
Hi all,
How to make a combo box from 1 form be the unchangeable value in another form combo box and be in every line of the table?
[FONT=&quot][/FONT]
 
Or there can be an automatic entering of the value in first form in every new line in the table of the second form.
 
Repetition of data - that's one of the issues normalization gets rid of but what you are proposing is introducing this bad practice.

You don't need to save the value in the table if it's going to be repeated.

Or can you elaborate on the problem so we can get a better understanding?
 
I integrated the [FONT=&quot]Password Login Screen with session login recording [/FONT]- PasswordLogin.mdb (http://www.access-programmers.co.uk/...d.php?t=193131) that DCrake made into my DB.(Thanks DCrake)


Now i want to make the combo box in the FrmLogin (CboUser) to be the locked value of the combo box of my main data entry form IZVESTAJ (DEZURNI DISPECER) so that in every line in my DB there is a record of the user that logged in and entered the line but with no possibility of change in the IZVESTAJ form. How to do this?
 
After the user logs in Lock the Combo box:
Code:
Me.ComboBoxName.Locked = True
 
Where to put this? What .Locked = True does? When the user logs in how to copy that username to the other form? I'm not good at coding :(
 
I've made some changes but because of the Row Sources you've used on the combo boxes, it won't work.

The first column in the Row Source of the Username combo box in frmLogin is [Tbl-Users].PKEnginnerID
The first column in the Row Source of the DEZURNI DISPECER combo box in IZVESTAJ is OSOBE.ID_OSOBE

Those two columns must be the same or else it won't work. So change the first column of DEZURNI DISPECER so that it is PKEnginnerID

Look at how to change that and the changes I made will work.

See attached.
 

Attachments

Can i change the raw source of the DEZURNI DISPECER so its directly connected to Tbl-User.
Firstly i want that the DEZURNI DISPECER be entered in a new record. Now i get it in a last record.
Also i need a User name not PKEnginnerID in the new line of the table.

Can you tell me what code did you use :)
 
Can you tell me what code did you use :)
The code I changed was in the Load event of IZVESTAJ. This line:
Code:
Me.DEZURNI_DISPECER.Value = Forms("frmLogin").Controls("CboUser").Value
Then in frmLogin, instead of closing the form, the Visible property was set to False. So remember this.

Can i change the raw source of the DEZURNI DISPECER so its directly connected to Tbl-User.
Unfortunately, I don't know. You understand your table relationships better than anyone.

Firstly i want that the DEZURNI DISPECER be entered in a new record. Now i get it in a last record.
Put this in the Default Value property of DEZURNI DISPECER
Code:
=[Forms]![FrmLogin]![CboUser]

Also i need a User name not PKEnginnerID in the new line of the table.
This isn't what you want. I noticed you did the same thing in your Osobe table too. You should be saving the ID not the name. This is what having a relational database is about.
 
I made it work :) thanks
Now the new record has the user logged on in DEZURNI DISPECER in IZVESTAJ :)
I want to make a List box that displays the name of the user that is logged on on my IZVESTAJ form.
How to do that? I only made lists from queries...

And how the DB that you sent me is 3MB and my is 9MB ?
 
I made it work :) thanks
Now the new record has the user logged on in DEZURNI DISPECER in IZVESTAJ :)
I knew you could do it :)

I want to make a List box that displays the name of the user that is logged on on my IZVESTAJ form.
How to do that? I only made lists from queries...
Can you explain a bit more?

And how the DB that you sent me is 3MB and my is 9MB ?
I did two things:
1. In the Code pane, Debug > Compile "Database Name"
2. Compact & Repair
 
I want to display the name of the DEZURNI DISPECER( user that logged in) on the form IZVESTAJ - there is a need for that information on that form. Can i use a list to display it or some other way of doing this is possible?
 
I mentioned how to do this a few posts away.

Another way is to use a DLookup()
 
I cant make it work...
This should be the code i think
Private Sub List90_AfterUpdate()

Me.List90.Value = Forms("frmLogin").Controls("CboUser").Value

End Sub
 
Yes, but the first column of your listbox MUST be the User ID.

Did you look into the second option I gave you?
 
Sorry for my ignorance... :( its unbound - how to set it to User ID and will that show the name or the autonumber of the user?
 
Create a query that will list the User ID and User Name. Use this query as the Row Source of your combo box. Change the Column Count and Column Width properties.
 
I did it :)
Would like to learn how DLookup() works :) That looks cool
 

Users who are viewing this thread

Back
Top Bottom