Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Louisville, Kentucky, USA
    Posts
    605
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Respective Records Only (2000)

    I have the following Function to trap certain information:

    Public Type UserInfo
    ViewID As Integer
    AccessID As Integer
    Active As Boolean
    Password As String
    UserID As String
    SecurityID As String
    End Type

    Public User As UserInfo

    I have a LOGIN that passes the UserID to STARTUP form ....so far so good...no problems...(at least not yet...LOL)

    My tblHoldUserID has 1field, txtUserID, that I want the UserID passed to it from the Startup form...and it won't...and I don't know why.................problem #1
    Here is the code I'm using for that:

    The following is the code I'm using in the OnOpen event of the StartUp form:
    Dim dbs As DAO.Database
    Dim rst As DAO.Recordset

    Set dbs = CurrentDb
    Set rst = dbs.OpenRecordset("tblHoldUserIDs", dbOpenDynaset)

    With rst
    .AddNew
    ![txtUserID] = User.SecurityID
    .Update
    End With

    ************************************************** ************************************************** ***
    My tblMain has a field, txtUserID......

    I use a switchboard to open frmUpdateProjects which uses tblMain as the recordsource....when it opens I only want the records for the USER that logged on. i.e. if my UserID=5, and I log in...then I want ONLY the records from tblMain WHERE txtUserID=5....................problem #2

    Thanks in advance for any advice.
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  2. #2
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Louisville, Kentucky, USA
    Posts
    605
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Respective Records Only (2000)

    OK...

    I have problem #1 worked out....I did the following:

    Dim dbs As DAO.Database
    Dim rst As DAO.Recordset

    Set dbs = CurrentDb
    Set rst = dbs.OpenRecordset("tblHoldSecIDs", dbOpenDynaset)

    With rst
    .AddNew
    .Fields("txtUserID") = Me.txtUserID
    .Update
    .Close
    End With

    Set rst = Nothing
    Set dbs = Nothing

    If anyone has input on problem #2....would certainly love to hear it.
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  3. #3
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Respective Records Only (2000)

    Roberta
    Can you be a bit more specific as to problem 2.

    My tblMain has a field, txtUserID......

    I use a switchboard to open frmUpdateProjects which uses tblMain as the recordsource....when it opens I only want the records for the USER that logged on. i.e. if my UserID=5, and I log in...then I want ONLY the records from tblMain WHERE txtUserID=5....................problem #2


    Does your switchboard also have the user ID in its record source ?

    I'm not quite sure on your "frmUpdateProducts", is it Datasheet or Single Form.

    With Datasheet, you could create a filter, where as Single form can source itself either from a query or a link as in the stLinkCriteria scenario.

    Perhaps a snap shot of the form, or even better a demo less than 100k zipped.

  4. #4
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Louisville, Kentucky, USA
    Posts
    605
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Respective Records Only (2000)

    Dave,

    1. No
    2. Single Form

    I will try to get the db to 100k...in the meantime....here is where I'm at..and it's working...but I doubt it will once multiple users begin logging in together.

    I created a qry using tblHoldUserID and tblMain where the join is on UserID....named that qry "qryUpdateProjects" and made it the recordsource to frmUpdateProjects. It's working....but that's because tblHoldUserID is only holding 1 UserID....once multiple user begin logging in, this will become a problem.

    Should I put the UserID on the Switchboard?

    Thanks for your assistance.
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  5. #5
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Louisville, Kentucky, USA
    Posts
    605
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Respective Records Only (2000)

    OK...finally got it small enough...here it is.


    When you first open it...select guest and change UserID to 7 in tblInitialTable
    Attached Files Attached Files
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  6. #6
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Respective Records Only (2000)

    Roberta,

    Where did you define the User type? It doesn't seem to be included in the database you posted and the code doesn't compile even after setting the DAO reference needed. I see where you're populating it in the frmUserLogon but unless you've declared it public in a standard module, it won't be available, and you would be better off populating it and passing it into your routines rather than relying on a global, if that's what you're doing.

    Which form loads first normally, frmStartup or frmUserLogon?
    Charlotte

  7. #7
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Respective Records Only (2000)

    Roberta
    I'm having the same problem as Charlotte.
    "User" doesn't seem to be declared any where so it's difficult to determine whats happening.

  8. #8
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Louisville, Kentucky, USA
    Posts
    605
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Respective Records Only (2000)

    So Sorry....didn't realize I omitted the mod's. Tried to put them in and then the db was larger than 100k, so I'm attaching a db with them ONLY, if you could just import them into the db that is in the previous post it should be fine.

    Again .... so sorry. And Charlotte, they are being declared in a public module...you will see.

    Thanks.
    Attached Files Attached Files
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  9. #9
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Louisville, Kentucky, USA
    Posts
    605
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Respective Records Only (2000)

    Dave,

    Is your response after I posted the other db? And Logon form loads first.

    Thanks.
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  10. #10
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Respective Records Only (2000)

    Roberta.

    With your update form, Can't it be based on a query and in the criteria, use the User ie:-
    This way, the form will open with all records for that user.
    Other than that, You need the User(ID) on the calling form.
    Attached Images Attached Images

  11. #11
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Louisville, Kentucky, USA
    Posts
    605
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Respective Records Only (2000)

    GMA,

    I have the complete db to 118k...it's the best I can do...it's functional the way it's suppose to be...don't know what else to do....it has the forms (w/startup set) all neccessary mods, tables, etc. it is working from this end (not as nice and pretty as it is suppose to be...cuz it's all stripped down, but...) a sample none the less.....it is still too large to post here...if ANYONE would like to take a look at it for my problem #2....please let me know...and maybe I can PM you with it.

    Thanks in advance.
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  12. #12
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Respective Records Only (2000)

    Roberta
    I tried this on your switchboard to try and bypass the standard microsoft code:

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "frmProjectInfoSheet/Record"

    stLinkCriteria = "[UserID]=" & Me![txtUserID]
    DoCmd.OpenForm stDocName, , , stLinkCriteria

    If you can incorporate this as a separate menu button, it may work.

    I'm sorry if I can't help any further.

  13. #13
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Respective Records Only (2000)

    Frankly, the do-it-yourself security on this is so complicated, I can't make it work at all, particularly since it wants a new password but the form for capturing it is not there.
    Charlotte

  14. #14
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Louisville, Kentucky, USA
    Posts
    605
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Respective Records Only (2000)

    Thanks Charolette,

    I removed that form for compacting purposes....so sorry...that's why I specified signing in as a guest, password as 8888 and changing the first record in the table to 7......but that's OK....I will muddle through this and figure it out....thanks for taking the time to look at it.....never dreamed it would be this difficult.

    I would put the norm Security on this.....but the boohooers here don't want it and as I mentioned a month or so ago....none of the db's here are protected...so I'm doing the best I can to protect the code, forms, tables, etc........at any rate..................thanks again..........I will keep on trying to figure this out.

    Have a nice day.
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  15. #15
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Respective Records Only (2000)

    Roberta,

    I didn't see any reference to the password in your earlier post or I wouldn't have had so many problems with it. I'll take a look, but I'm in bed with a code today, so I don't know how useful I'll be ... or how often.
    Charlotte

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •