Question with MS Access database...

1. how to pass a global variable from one form to another
I have two forms: Switchboard and Master log
on the start (Switchboard) there is no problem, it gets the username based on the windows Id (ModFosUser). Then when you make a selection to go EE Queue log it will open the second form. Now, when you hit the NEw button it should bring Your name to EE Name and fill Creation Date with today's date (working )
2. what to do to make sure it will fill the grid only after filling all mandatory fields..
in my case those are:
EEName
Creation date
SA no
queue type
queue status
Really need your help
Master-stats---test.accdb
rfedorovAsked:
Who is Participating?
 
John TsioumprisConnect With a Mentor Software & Systems EngineerCommented:
I must say it...i missed the split form feature on the newer Access versions...but in your case i reckon is not what you need...
you have a clear parent-child relationship between the employee and the task he/she assigned to....so the split form is not helping to this direction
take a look at my quick and very "dirty" sample and let me know
Master-stats---test.zip
0
 
MacroShadowCommented:
1. The definition of a global variable is that it is accessible from all forms. Set it once and it stays in memory until cleared.
In your case you can also use the OpenArgs property of the form instead of global variable. OpenArgs is the last parameter of the DoCmd command, is is used to send a string to the form that is being opened.
DoCmd.OpenForm FormName, View, FilterName, WhereCondition, DataMode, WindowMode, OpenArgs

2. Check in code that all are mandatory fields are filled in the BeforeUpdate event.
0
 
rfedorovAuthor Commented:
thank you for your fast response, sounds not clear...
where should i put those?
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
MacroShadowConnect With a Mentor Commented:
Sorry, I thought you just needed a push in the right direction.
Master-stats---test.accdb
0
 
rfedorovAuthor Commented:
sorry, what you did you put windows id, I do not need that, I know how to get that, I need Name....
0
 
MacroShadowCommented:
I don't understand. What is "Name"?
0
 
rfedorovAuthor Commented:
Ok, i was able to "fix" that, the first thing is working, let me check the second part, thank you very much
0
 
rfedorovAuthor Commented:
for example the windows id fedoror, the name associated is  Roman Poul. all info from tbl_user

ID      sUserID      sUserName      sUserWindowsID      sUserDeviceID      Active      sUserRole
15      015      Roman Poul      fedoror      D194347      True      2
0
 
rfedorovAuthor Commented:
Thank you, learned a lot
I have two more questions, promise they are small:
1. On my Switchboard form the name right after a Welcome has a slightly different color of the font, It does not matter what i do, it does not look the same how the rest of words on the form
2.  I f i want to cancel the adding the new record during the input what should be added?

and thank you for adjusting the module, thank you
0
 
MacroShadowCommented:
1. in design view make sure all the labels properties match.
2. hit the Esc button.
0
 
rfedorovAuthor Commented:
thank you, the control which does not match the rest of the labels is text box...
0
 
MacroShadowCommented:
change it to a label
0
 
rfedorovAuthor Commented:
thank you guys
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.