access vba - Pass Username through LoginForm, to GreetingForm, to NavigationForm -


i have problem database. when login username loginform greetingform opens , loginform closes. username appears on greetingform, when click on button on greetingform closes , open navigationform username not appear on navigationform. can please me fix problem. click on link below see more details.

click on link please

i create tempvars. these introduced in access 2007 , unlike public variables, hold value under duress of code error. tempvars global , can created in module type , supported in queries.

i change textbox combobox. can refer column number select initials.(column width 0cm)

how use:

option compare database option explicit public g_username tempvars  private sub cmdlogin_click()    if isnull(cbo_username)      msgbox "please select user"   else      tempvars!g_username = me.cbo_username.column(1)      docmd.close      if currentproject.allforms("greetingform").isloaded = false         docmd.openform "greetingform", acnormal, , , acformedit     end if   end if end sub 

you can refer =g_username in form require creating text box , entering =g_username. alternatively should able in vba so:

forms![greetingform]![txtlogin] = tempvars!g_username 

you can repeat initials, refer whichever column initials in. remember counting starts column(0).


Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -