Results 1 to 15 of 15
  1. #1
    Neophite is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2013
    Posts
    13

    Input into unbounds on an unbound form from unbound form with an unbounds

    I have an unbound form in which I am performing a login function: user name and password validation. It uses an unbound combobox with an unbound text control. The combobox pulls a string of five fields from the employee record table. The user selects their name from the list and inputs their password, validation occurs, and then based upon the user’s level, they are routed to the appropriate Navigation Control Form. This part works like a champ.



    The problem I am having is that within the unbound Navigation Control forms there are several unbound text controls which I am trying to populate with data contained in the data string pulled by the combobox. I have found several potential go-bys, but I can’t seem to make the them work due to my poor grammar. I am now thinking about how I might use gintThis’s and gintThat’s, and go from there. Any suggestions would be appreciated.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    Is this what you're after?

    http://www.baldyweb.com/Autofill.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    In versions 2007/2010 the easiest way would probably to use global variables utilizing the new TempVars which, unlike previous global variables, don't lose their values if an error occurs.

    Help should give you the needed info on declaring and setting them.

    Linq ;0)>

  4. #4
    Neophite is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2013
    Posts
    13
    Thanks for the input. I looked at the solution offered and it looked to me like the unbound text control being updated was on the same unbound form. I am trying to update unbound text controls on another unbound form. I did however learn something, which was good. Another kind soul offered a solution using Tempvar's. I plan on playing with that idea tomorrow. I also found some possible solutions and "go-bys" in the Inside Out book. I suspect this problem will tease me for another couple of days. Thanks again for your suggestion.


    Quote Originally Posted by pbaldy View Post
    Is this what you're after?

    http://www.baldyweb.com/Autofill.htm

  5. #5
    Neophite is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2013
    Posts
    13
    Thanks for the input. I found a refence on Tempvars and their use and abuse in Access 2010 Inside Out. I'll give it a whirl.

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    Quote Originally Posted by Neophite View Post
    I looked at the solution offered and it looked to me like the unbound text control being updated was on the same unbound form. I am trying to update unbound text controls on another unbound form.
    Being on a different form is a simple matter of using the appropriate syntax:

    http://access.mvps.org/access/forms/frm0031.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    Neophite is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2013
    Posts
    13
    Thanks. Pretty darn ineresting. That is a wonderful cheat sheet that helps me in several other problems I'm tinkering with. Okay, so I'll go back to the drawing board and play with it. Great -- another learning experience. Also, I'll ponder its use as it relates to deciphering this diddy I found someplace else: strSQL = "Update[activeEmp_Temp] set(ActiveEmp_Temp.Control.Number = " "& Forms![EmpAssignment_Log]![Control_Number] &")". I don't know if the syntax is correct as my scribbled note on the back of the napkin was done in haste. I feel like I'm a blind dog walking around a room bumping into things with my head; but eventually I, like most blind dogs, will figure out where all the head knockers are and thus be able to navigate the room, until someone moves the furniture.

    Quote Originally Posted by pbaldy View Post
    Being on a different form is a simple matter of using the appropriate syntax:

    http://access.mvps.org/access/forms/frm0031.htm

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    No problem. Your diddy is someone building SQL in code. They are concatenating the value of a form control into the string. Here's a tutorial on that if you're interested:

    http://www.baldyweb.com/BuildSQL.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    Neophite is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2013
    Posts
    13
    So far no luck. Here is what I currently have after bumping into everything in the room a couple of times:

    I have a unbound login form with an unbound combobox with which I do a user name and password validation. The combobox selects 6 fields from a table with the sixth field being the employee ID number. Works like a champ. After the validation, the application loads the appropriate unbound Navigation form. The code is as follows:

    'Password is Correct
    'Load EmployeeID from Combobox into gintEmployeeID
    Me.[Combo21].Column(5) = gintEmployeeID
    'gintEmployeeID = Me.Combo21.Column(5)
    'Select appropriate Navigation form
    Me.Visible = False
    If Me.[Combo21].Column(4) = 0 Then
    DoCmd.OpenForm "TeamMemberNavigation"
    Else
    DoCmd.OpenForm "TeamLeaderNavigation"
    End If
    'Close Login form
    DoCmd.Close acForm, "DatabaseLogin", acSaveNo
    cmdDatabaseSignin_Click_Exit:
    Exit Sub

    cmdDatabaseSignIn_Click_Err:
    MsgBox "Err during DatabaseSignin: " & Err & ", " & Err
    Resume cmdDatabaseSignin_Click_Exit
    End Sub

    I have the following Module for the public variable:

    Option Compare Database
    Option Explicit

    Public gintEmployeeID As Integer

    In the Navigation form, I have the following code to pass the employee ID number from gintEmployeeID to the unbound text box: EmployeeID:

    Private Sub EmployeeID_OnOpen()
    TeamMemberNavigation!EmployeeID = Me!EmployeeID
    Set Focus = Me!EmployeeID
    'Pass EmployeeID from gintEmployeeID to textbox
    gintEmployeeID = Me!EmployeeID
    'Me!EmployeeID = gintEmployeeID

    Also in the Login form I have:

    Private Sub Form_Load()
    'Make sure current EmployeeID is reset when Login form loads
    gintEmployeeID = False

    End Sub

    It dies a miserable death at "Me.[Combo21].Column(5) = gintEmployeeID" in the Navigation form selection routine.

    So, what think you?

  10. #10
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    Based on your description:

    'Load EmployeeID from Combobox into gintEmployeeID
    Me.[Combo21].Column(5) = gintEmployeeID

    You've reversed them. What you have is trying to put the value of the variable into the combo.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  11. #11
    Neophite is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2013
    Posts
    13
    Quote Originally Posted by pbaldy View Post
    Based on your description:

    'Load EmployeeID from Combobox into gintEmployeeID
    Me.[Combo21].Column(5) = gintEmployeeID

    You've reversed them. What you have is trying to put the value of the variable into the combo.
    After I sent my previous reply, it struck me that I might have my tos and froms mixed up. You have confirmed my blunder. However, after I changed it as specified, it choked at that line and Access froze up. I have read nearly a couple of dozen posts on various forum sites on the same subject. The name of the mod is unique, but perhaps it is not initialized/activated (the login form is the first place it is used) in the right location or I am missing some step/declaration that loads it or calls it.

  12. #12
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    It freezes? I assume you mean the variable is declared in a standard module? Shouldn't matter, and you don't have to do anything to initialize it. Can you post the db here?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  13. #13
    Neophite is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2013
    Posts
    13
    Quote Originally Posted by pbaldy View Post
    It freezes? I assume you mean the variable is declared in a standard module? Shouldn't matter, and you don't have to do anything to initialize it. Can you post the db here?
    We probably need to take this discussion offline if at all possible as the DB contains security sensitive information and procedures of a government entity.

  14. #14
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    You can email it to me if you want

    pbaldy
    gmail
    com
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  15. #15
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    In reference to your question emailed with the db:

    For starters, I am trying to get the EmployeeID from the Login form to the Navigation form so that I can populate a field in the header and then use it via queries, etc., to fill the name fields in that header and all subsequent form and subform headers, and to populate the EmployeeID field on all the transaction records created by an individual .

    Since you also have other info in that combo, I'd probably leave the login form open but hidden. That lets you access it from any of the places you mentioned. If you want to "get it to the navigation form":

    Forms!TargetFormName.TargetControlName = Me.Combo21
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 2
    Last Post: 10-17-2012, 01:35 PM
  2. Unbound Text Box Input to Query Issue
    By DB2010MN26 in forum Forms
    Replies: 2
    Last Post: 09-14-2011, 10:12 AM
  3. Replies: 5
    Last Post: 06-28-2011, 06:40 PM
  4. Replies: 0
    Last Post: 05-09-2010, 08:43 AM
  5. Input data In unbound text box
    By chu3w in forum Forms
    Replies: 1
    Last Post: 04-01-2010, 10:21 AM

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