Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Private Sub cmd_SubmitCmd_GotFocus()
'------------------------------Help System
If txtInput Like "help-*" Then
'They at least started a specific help
txtValueHold = "help"
Call comSys.help(Me)
Call LMNav.comSysCommdandEnd(Me)
ElseIf txtInput Like "HelpMe*" Then
'Then they didnt specify type of help they wanted
txtValueHold = "help"
Call comSys.helpgeneral(Me)
Else:
Call LMNav.comSysCommdandEnd(Me)
txtDisplay = CurrentUser() & " - That command isn't recognized"
txtValueHold = Null
txtValueHold2 = Null
End If
Public Function help(frm As Form)
if frm.txtInput = "help-strength" then
call helpstrength
elseif frm.txtInput = "help-purpose" then
call helppurpose
elseif frm.txtInput = "Help-export" then
call helpexport
end if
public function helpstrength(frm as form)
frm.txtDisplay = "This is help for strength command"
end function
public function helptpurpose(frm as form)
frm.txtDisplay = "This is help concerning your purpose"
end function
public function helpexport(frm as form)
frm.txtDisplay = "This is help on exporting"
end function
Please elaborate on what you are meaning by not hard coding control names, but would send names into each function that needs it. I may be using the wrong approach here.
Public Sub changeProperties(ctrl As Access.TextBox)
'pass in an textbox object
'A simple procedure that can change properties of any textbox in the database
With ctrl
.ForeColor = vbRed
.BackColor = vbBlue
.FontBold = True
.FontItalic = True
End With
End Sub
Public Sub testCP()
changeProperties (Me.txtBox1)
changeProperties (Me.txtBox2)
changeProperties Forms("someOtherForm").txtbox3
End Sub
public function myMath(A as double,B as Double, C as double)as double
dim aPlusB as double
'Never use it in the function, but Pass A and B back out
aPlusB = getAplusB(A,B)
myMath = aPlusB * C
end function
public function getAplusB(A as double, B as double)
getAPlusB = A + B
end function
Public Function func1(ByVal A As Double, ByVal B As Double, ByVal C As Double) As Double
'do not do anything just pass it out
func1 = func2(A, B, C)
End Function
Public Function func2(ByVal A As Double, ByVal B As Double, ByVal C As Double) As Double
func2 = func3(A, B)
func2 = func3(func2, C)
End Function
Public Function func3(ByVal X As Double, ByVal Y As Double) As Double
func3 = X + Y
End Function
Public Sub testfunc1()
Debug.Print func1(3, 4, 5)
End Sub
Public Function recursivePattern(strPattern As String, TotalIncrement As Integer, Optional ByVal currentIncrement As Integer = 0, Optional ByVal currentPattern = "") As String
Do While currentIncrement < TotalIncrement
currentIncrement = currentIncrement + 1
currentPattern = currentPattern & strPattern
Call recursivePattern(strPattern, TotalIncrement, currentIncrement, currentPattern)
Loop
recursivePattern = currentPattern
End Function
Public Sub testPattern()
Debug.Print "Make Pattern: " & recursivePattern("ABC", 5)
End Sub