Skip to content

Instantly share code, notes, and snippets.

@onlyforbopi
Last active January 29, 2018 15:06
Show Gist options
  • Select an option

  • Save onlyforbopi/133dd01693e3f89a8666271a0ed7fbc7 to your computer and use it in GitHub Desktop.

Select an option

Save onlyforbopi/133dd01693e3f89a8666271a0ed7fbc7 to your computer and use it in GitHub Desktop.
1. Assign Value to Textbox / Clear Value of TextBox 2. Set Focus to TextBox 3. Change bg color
' Change color of textbox based on conditional (Frequest Use)
If DirExists(WorkDirectory) Then
MsgBox ("Work directory located.")
Me.LabelStatus.Value = "Initial Checks Successful."
Me.LabelStatus.BackColor = lngGreen
Else
MsgBox ("Work directory: " & WorkDirectory & " was not located. Please restart application.")
Me.LabelStatus.Value = "Initial Checks Unsuccesful. Work Directory not located"
Me.LabelStatus.BackColor = lngRed
End If
' When Assigning values to textboxes : Important to check which table field
' each textbox corresponds with, and what data type it is.
' Assign date value to TextBox
Me.TextBoxCurrDate.Value = Format(Date, "mmddyy")
' Assign current user value to TextBox
Me.TextBoxCurrUser.Value = CurrentUser()
' Assign normal value to TextBox
Me.TextBox3.Value = "Panagos"
' Clear value of textbox
Me.TextBox3.Value = Null
' Set TextBoxFocus
' Set focus to starting Textbox - Usually handled in form load
Me.TextBoxPod.SetFocus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment