Hi All,
Firstly I am working in access 2010. I am trying to create an event (activated by clicking a button on a form) where by a filtered report will be opened. The form in question is bound to the table where the results will be coming from and contains an option group with three options: 1 month (value = 1), 2 months (value = 2) and 3 months (value = 3).
So we're clear the report I am trying to generate will show...
User Profile
Collapse
Profile Sidebar
Collapse
anewuser
Last Activity: Feb 7 '13, 01:56 PM
Joined: Oct 28 '12
Location:
-
Hi NeoPa, I have decided to go with the read only route on my existing form and I have formatted it as such.
Thanks for your help so far it is much appreciated -
To clarify the data edits should only be made to to the record currently being viewed in the main body of the form. The reason for the split form is so that the user can select the appropriate record.
I do, however, realise the weakness here the macro (I believe) will only work for the record that is currently being viewed. If the data is editted in the part of the form which shows all of the matching records then the old record(s)...Leave a comment:
-
Hi I am sorry it has been a while since my last reply. I have now created a composite PK on my archive table. It took me a little while to find out how to do this which the reason for the delayed reponse.
The event is triggered by clicking on a button called "Update Record" on a split form which shows a list of matching records found by a search form. Edits to the data are made on the form and then the user clicks the button...Leave a comment:
-
The date/time stamp is applied at the time the record is created in the primary table by setting a default value of Now() in the "Date of last amendment" field. When the data is archived this value remains the same for the archived record and a new date/time stamp is applied to the updated record. There is a button which is clicked to apply the change.
However, the problem that I am having is that my macro is only selecting...Leave a comment:
-
You are right NeoPa, the archive table does not have a primary key as it does allow for multiple data edits and does have a date/time stamp setup to record when data is added to it. The primary table does use a primary key. I believe what you are asking for is a list of the fields of each table (I am sorry if I am wrong).
Primary table:
Record Number (PK) AutoNumber
Designation Text
First Name ...Leave a comment:
-
That sounds like an intriguing idea, I am happy to give any suggestion a go. I have got a backup available if I mess things up. Your help would be really appreciated.Leave a comment:
-
tracking data edits across different tables
Hi everyone,
Firstly I am using access 2007. I currently have 2 tables in my database, 1 to store up to date data and the other to store out of date data (where data edits have been made, for audit purposes). I have set up a one-to-many relation ship between the 2 tables based on the record number.
I use a form to search for records which opens up a split form to show all of the matching records. I do have a code which... -
I was able to login as normal using the code from post 35. However, it was not updating the usyscurrentuser table. I fixed this by changing the source of the form from nothing to the usyscurrentuser table. This worked, now when I log in it adds a new record into this table. Probably not the best way to sort the problem but it has worked and I am happy with it.Leave a comment:
-
Hi Everyone, I know it has been a while since my last post and this is because everything now works fine and i haven't had the time to get back online to thank you all for all of your help.Leave a comment:
-
Hi I tried running that line (from post #44) in the immediate pane. I was still able to login as normal but usyscurrentuser wasn't updated.Leave a comment:
-
I am still struggling to activate the debugging mode. I have even tried putting a code break on the very start of the code and have even put a code break on every line but it just won't start the debugging mode.Leave a comment:
-
Yes it is in the same condition as post #38. In answer to Z I have fixed all the errors that were found during compiling (the whole project is now compiled. But I have not placed the stop command in yet and I have deactivated the special keys option in access options.Leave a comment:
-
Hi, as it turns out I do still need some help I have compiled the project that I have so far and no errors have been returned. However, the usyscurrentuser table is not being updated and I don't understand how the code should currently work to set the username as the currentuser.Leave a comment:
-
Just FYI to all those who have helped me in this thread. I have just tried Rabbits suggestion of "it should be an End Select" and "You probably also want an End If after line 33." and it worked...
I have so far tried it against all the valid usernames and passwords I have got set up and against all invalid conditions i.e. valid username invalid password, invalid username valid password and both username and password...Leave a comment:
-
Hi I have tried both of your methods and have still come up with nothing.Leave a comment:
-
Hi, I have followed your advice and have chaecked the properties of the command button. It is called Login and the event is in the "on click" property. I have also looked at the http://bytes.com/forums/feedback/913...g-vba-sql-code that has been suggested and have tried to compile the code. It doesn't come up with an error but it does in another do I need to rectify this before it will find more or are all problems identified...Leave a comment:
-
Hi have tried putting the stop command and a codebreak point before the select case line but still the debugging mode did not activate. and still no data updated, no messages displayed and no forms opened.Leave a comment:
-
Hi my current code is:
...Code:Option Compare Database Option Explicit Private Sub Login_Click() Dim strSQL As String, strForm As String, strMsg As String Dim dbVar As DAO.Database strSQL = "([UserInitials]='%I') AND ([Userpassword]='%P')" strSQL = Replace(strSQL, "%I", Me.UserName) strSQL = Replace(strSQL, "%P", Me.Password)Leave a comment:
-
Hi, the amended code still isn't working. I don't know there is any more information that you need or if there is anything that I can do to test the current code other than trial and error (which I am currently doing).
For what it's worth I have just tried all of the usernames and passwords currently set up in tbl_User each one tests the different cases and one which is not in the table and each time nothing happens.Leave a comment:
No activity results to display
Show More
Leave a comment: