Results 1 to 9 of 9
  1. #1
    shabbaranks is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Oct 2011
    Posts
    162

    Not too sure if its a query or vba?

    Hi Guys,



    Im trying to find a way to - I guess its query a table and find the last entry by a perticular field in this case its the sUser field which is a username. Any ideas please?

    The reason for this is I want to display the last date a form was submitted.

    Thanks muchly

  2. #2
    hertfordkc is offline 18 year novice
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    481

    Last entry by username or date?

    <<Im trying to find a way to - I guess its query a table and find the last entry by a perticular field in this case its the sUser field which is a username. Any ideas please?

    The reason for this is I want to display the last date a form was submitted. >>

    You didn't spell out your data arrangement, but I'm guessing that you have
    the dates when the forms were submitted and the username who submitted it. Therefore, a query is the appropriate tool.
    In VBA, there is a .movelast command, but I don't think it is appropriate for what you need.

  3. #3
    A S MANN is offline Advanced System Analyst
    Windows XP Access 2007
    Join Date
    Oct 2010
    Location
    India
    Posts
    163
    Add two field to Table.
    Time_of_submissionefaultValue:Now()
    Person_SubmittedefaultValue:GetUser()
    Carry these field to your Sourcs Query and in Form where user submite the Form.
    when user submite the form Table will update the field automatically.
    We need to down load GetUser() fuction.Contact me i can provide you this fuction.
    Is this you are looking for.

  4. #4
    shabbaranks is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Oct 2011
    Posts
    162
    Ive already captured the username its just the Time_of_submission I need to add. When you say add two fields - do I call them these names or do I create a hidden textbox on the form which adds this?

    Sorry Im not too sure what you mean.

    Thanks

  5. #5
    A S MANN is offline Advanced System Analyst
    Windows XP Access 2007
    Join Date
    Oct 2010
    Location
    India
    Posts
    163
    Follow the steps
    1:Your Table where you already captured the username,add one more field Time_of_submission with DefaultValue:Now(),
    2:Carry these field to your Sourcs Query and in Form where user submite the Form.
    3:when user submite the form Table will update the field automatically.
    4: In Form Footer add the field Time_of_submission and username.
    5:Form show Time_of_submission and username as you navigate in the form.
    Is this you are looking for.
    You need to spell out your requirement more specifically with a example(if possible)
    Thanks

  6. #6
    shabbaranks is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Oct 2011
    Posts
    162
    Hi A S Mann,

    Thanks, this collects the data and puts it in a table but how would I then output to a text box the last date user x submitted their entry? Im guessing I would have to create a query which looked at the user field and the time_of_submission field but other than that Im stuck?

    Thanks

  7. #7
    A S MANN is offline Advanced System Analyst
    Windows XP Access 2007
    Join Date
    Oct 2010
    Location
    India
    Posts
    163
    I think you need a form showing User Name and Date of Submission along with other data entry fields.The same Form where Data is entered will be able to show User Name and Date of Submission at the form footer. No Seperate query is required. I will be Soon giving you a sample DB as example to show. Use the same technique in your DB.

  8. #8
    A S MANN is offline Advanced System Analyst
    Windows XP Access 2007
    Join Date
    Oct 2010
    Location
    India
    Posts
    163
    View the DB attached herewith as a sample to solve your query
    Comment on it

  9. #9
    shabbaranks is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Oct 2011
    Posts
    162
    Thanks A S Mann I did actually resolve this one by using

    Code:
    =DMax("[Time_Of_Submission]","TimesheetTable","sUser='" & [LoggedInUser] & "'")

Please reply to this thread with any new information or opinions.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums