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.
[blue] Dim Ans As String, Prompt As String, Title As String
Prompt = "DC Code you want to go to?"
Title = "DC Code?"
Ans = InputBox(Prompt, Title)
If InputBox(Prompt, Title) <> "" Then
DoCmd.OpenForm "Register form", , , , , , Ans
End If[/blue]
[blue] Dim rst As DAO.Recordset
Dim Msg As String, Style As Integer, Title As String
Set rst = Me.RecordsetClone
rst.FindFirst "[dc code]='" & Me.OpenArgs & "'"
If rst.NoMatch Then
Msg = "DC Code '" & Me.OpenArgs & "' NOT FOUND!"
Style = vbInformation + vbOKOnly
Title = "Can't find 'DC Code' Error! . . . . ."
MsgBox Msg, Style, Title
Else
Me.Bookmark = rst.Bookmark
End If
Set rst = Nothing[/blue]
[blue][b]Change:[/b]
If [purple][b]InputBox(Prompt, Title)[/b][/purple] <> "" Then
[b]To:[/b]
If [purple][b]Ans[/b][/purple] <> "" Then[/blue]
[blue] Dim rst As DAO.Recordset
Dim Msg As String, Style As Integer, Title As String, DL As String
DL = vbNewLine & vbNewLine
Set rst = Me.RecordsetClone
rst.FindFirst "[dc code]='" & Me.OpenArgs & "'"
If rst.NoMatch Then
Msg = "DC Code '" & Me.OpenArgs & "' NOT FOUND!" & DL & _
"Do you want to register the DC Code?" & DL & _
"Click 'Yes' to register." & DL & _
"Click 'No' to abort . . ."
Style = vbQuestion + vbYesNo
Title = "Register DC Code ?"
If MsgBox(Msg, Style, Title) = vbYes Then
DoCmd.RunCommand acCmdRecordsGoToNew
Me![purple][b]TextboxName[/b][/purple].DefaultValue = Me.OpenArgs
End If
Else
Me.Bookmark = rst.Bookmark
End If
Set rst = Nothing[/blue]
[blue] If Ans <> "" Then
DoCmd.OpenForm "Register form", , , , , , Ans
[purple][b]Forms![Register form].SetFocus[/b][/purple]
End If[/blue]
[blue][b]Change:[/b]
Me!TextboxName.DefaultValue = [purple][b]Me.OpenArgs[/b][/purple]
[b]To:[/b]
Me!TextboxName.DefaultValue = [purple][b]Val([/b][/purple]Me.OpenArgs[purple][b])[/b][/purple][/blue]
[blue] Me![[purple][b]TextboxName[/b][/purple]].DefaultValue = """" & Me.OpenArgs & """"[/blue]