Automatically create command buttons on form

Marinus

I'm learning... :)
Local time
Today, 19:39
Joined
Jun 16, 2010
Messages
140
Hi Guys,

Here is the crazy guy again, first of all I want to wish everybody a Merry Christmas and a Happy New Year, with these wishes goes a great amount of gratitude for the help and the things I learn from all of you.

I have a weighbridge application that is mostly operated from one form, several operators make dockets on this screen, now I want them to press a cmdButton to register their name in the record, this is the way I do it now;

Code:
Private Sub cmdWBO_Monika_Click()
Me.WBOperator = "Monika Trczinska"
End Sub

Private Sub cmdWBO_Pat_Click()
Me.WBOperator = "Pat Loopy"

End Sub

Private Sub cmdWBO_PatLalor_Click()
Me.WBOperator = "Pat Lalor"

End Sub



Now in this world people come and go and I was wondering if I could code the buttons on the form based on a table called tblWBOperators
 

Attachments

  • WBProject-01 11.11.jpg
    WBProject-01 11.11.jpg
    46.8 KB · Views: 127
Hi, Reece

Why you are not thinking about the login form?
where you can provide username and password to the user so they can type their username and password which will be registered in a logTable with the time and dateStamp.

Regards.
 
Hi, Reece

Why you are not thinking about the login form?
where you can provide username and password to the user so they can type their username and password which will be registered in a logTable with the time and dateStamp.

Regards.

Thanks for thinking with me Khalid, the form is used all day by different people and they don't want to log-on/off every time a new docket is created by another operator, there would be a number of operators and a press on the cmdButton would prevent that.. They would have to sign a printed docket anyway this way we could keep control over some of the action on the yard.
 
have the operator field as OPERATORID on your main table -

then - have this look up values from your OPERATORID table with all the details in. then - when they have Created a docket - just write the operator ID to record which is saved in the main table. make sense ?

so - instead of a "select operator button" - you would have a drop down on the main form with all the operators in the operatorID table. when they select it gets written to that record.
 
post your app if you want and ill make the changes.
 
As reddwarf said, a Combobox to select the user from really makes more sense than a button for each user. It obviates the problem that would occur every time a new user was added or taken away.
 
post your app if you want and ill make the changes.

Thanks Reddwarf, here is the app, wonder what it would look like with 4 lists/ combo boxes, the code is probably a mess but I tried to keep it as tidy as I can for a beginner.. Anyway, here is my attempt...
 

Attachments

need to do this at home as we only have access 2003 here. will sort the weekend, let me know if you still need it ?
 
need to do this at home as we only have access 2003 here. will sort the weekend, let me know if you still need it ?

Your great my friend, sorry for the late response but haven't been at computer for a while, after my question I got more operators, so went for a listbox as this is a touchscreen only application.. Thanks for your offer, sorted for now.. Wishing you a Happy and Prosperous New Year..
 

Users who are viewing this thread

Back
Top Bottom