First off, my database explained:
It's a training and induction program, where there are 8 courses that users can go through and complete, earning a certificate in that course. A login screen (made via form) automatically comes up, after the user clicks whether they are a 'User', 'Admin1' or 'Admin2' account to which they can then enter their details.
The tables contain users UserName which automatically generates itself once both the Fname and Lname are entered into the table, using this coded expression and a 'Calculated' field type:
in a calculated Data Type.
Question 1:
This works, great, wonderful, however: If there are two people named, for example, Declan Heart and David Heart, they will both be generated the username DHeart. For obvious reasons this won't work well with the system. What I want to happen, is:
Declan Heart, joined 30/03/2016 (DD/MM/YYYY), get's the username 'DHeart01'. The '01' comes from when the database will search through the user table to see if there is any user with the username DHeart01, if there isn't, he will be assigned 01. Then, if someone comes along with the same name, they will get DHeart02, and then 03, etc. Is there a way to do this via expressions?
Question 2:
At the end of the 'course' is it possible to have a prepared certificate of sorts, that the database will check the current logged in user and get their first (Fname) and last (Lname) from the user table, put it on a text box or whatever on the certificate, before opening it as a PDF or any type of document that can let the user save or print this certificate?
Question 2.5:
I was wondering what classifies the user as logged in? I think I've done a login form, but I don't know if that will work. The code works, and it's a correct form, I just don't know if it will work regarding to being the 'logged in' user for question 2.
The login form contains two text boxes named 'Username' and 'Password' and a submit button with this code attatched:
The code works fine, it searches the table and let's the user log in if the username and the matching password are entered correctly. Is this what classifies the user as 'logged in' and would work for question 2?
I want forms to be what the user uses at all times, and buttons being used to transfer the user between forms. The button will use a macro that closes one form and opens another, meaning only one form at all times should be open, and allow for an easy to use pathway for the user.
Which brings me onto question 3:
For this reason, I want none of the tables, forms or macros, or anything to be available for the user to click on and open by themselves. They should only be able to access pages via the forms that serve as the system 'front' almost. Is there a way to stop a form from being opened via the 'All Access Objects' pane no matter what user attempts to open it, including the forms, however it will still open if a macro runs that involves opening it?
I've also set up various 'one to one' relationships, from the user and two admin tables to the full user table. I want whenever one of them is changed or updated, the other tables to update, but currently they aren't even showing the same data. The record is the user table, doesn't add itself tot he full users table. Why is this/How can I change it so it does?
I also want to create a quiz, after each 'course'. So once the user has passed through the various forms showing the information, I want to create a multiple answer based quiz. They would select one option and then the select a submit button or something similar, this would then check against the correct answer and update there score. If they get 75% or over, then they are deemed successful and move on to get the certificate mentioned earlier, if not then a macro will transport them back to the start of the course.
I have loads more questions as essentially my teacher has taught me nothing and this project is due within a week, and so I'd be hugely grateful of ANY help. But this post is already huge so I'll just deal with these problems for now.
It's a training and induction program, where there are 8 courses that users can go through and complete, earning a certificate in that course. A login screen (made via form) automatically comes up, after the user clicks whether they are a 'User', 'Admin1' or 'Admin2' account to which they can then enter their details.
The tables contain users UserName which automatically generates itself once both the Fname and Lname are entered into the table, using this coded expression and a 'Calculated' field type:
Code:
Left([Fname],1) & "" & [Lname]
Question 1:
This works, great, wonderful, however: If there are two people named, for example, Declan Heart and David Heart, they will both be generated the username DHeart. For obvious reasons this won't work well with the system. What I want to happen, is:
Declan Heart, joined 30/03/2016 (DD/MM/YYYY), get's the username 'DHeart01'. The '01' comes from when the database will search through the user table to see if there is any user with the username DHeart01, if there isn't, he will be assigned 01. Then, if someone comes along with the same name, they will get DHeart02, and then 03, etc. Is there a way to do this via expressions?
Question 2:
At the end of the 'course' is it possible to have a prepared certificate of sorts, that the database will check the current logged in user and get their first (Fname) and last (Lname) from the user table, put it on a text box or whatever on the certificate, before opening it as a PDF or any type of document that can let the user save or print this certificate?
Question 2.5:
I was wondering what classifies the user as logged in? I think I've done a login form, but I don't know if that will work. The code works, and it's a correct form, I just don't know if it will work regarding to being the 'logged in' user for question 2.
The login form contains two text boxes named 'Username' and 'Password' and a submit button with this code attatched:
Code:
Private Sub Command1_Click()
If DLookup("Password", "tbl_User", "UserName = '" & Me.Username & "'") = Me.Password Then
MsgBox "Successful Login", vbInformation, "Central Bedfordshire Libraries Training and Induction"
DoCmd.Close
DoCmd.OpenForm "Frm_FirstLogin"
Else
MsgBox "Invalid Username/Password combination, please try again.", vbInformation, "Central Bedfordshire Libraries Training and Induction"
Me.Username.SetFocus
End If
End Sub
The code works fine, it searches the table and let's the user log in if the username and the matching password are entered correctly. Is this what classifies the user as 'logged in' and would work for question 2?
I want forms to be what the user uses at all times, and buttons being used to transfer the user between forms. The button will use a macro that closes one form and opens another, meaning only one form at all times should be open, and allow for an easy to use pathway for the user.
Which brings me onto question 3:
For this reason, I want none of the tables, forms or macros, or anything to be available for the user to click on and open by themselves. They should only be able to access pages via the forms that serve as the system 'front' almost. Is there a way to stop a form from being opened via the 'All Access Objects' pane no matter what user attempts to open it, including the forms, however it will still open if a macro runs that involves opening it?
I've also set up various 'one to one' relationships, from the user and two admin tables to the full user table. I want whenever one of them is changed or updated, the other tables to update, but currently they aren't even showing the same data. The record is the user table, doesn't add itself tot he full users table. Why is this/How can I change it so it does?
I also want to create a quiz, after each 'course'. So once the user has passed through the various forms showing the information, I want to create a multiple answer based quiz. They would select one option and then the select a submit button or something similar, this would then check against the correct answer and update there score. If they get 75% or over, then they are deemed successful and move on to get the certificate mentioned earlier, if not then a macro will transport them back to the start of the course.
I have loads more questions as essentially my teacher has taught me nothing and this project is due within a week, and so I'd be hugely grateful of ANY help. But this post is already huge so I'll just deal with these problems for now.