-
WSSupport4John
AskWoody LoungerSeptember 27, 2001 at 10:43 am in reply to: How to Test InputBox Results (Acc 2000 (9.0.4402) SR-1) #544325Hi Charlotte
Perfect, following is completed InputBox code for interest to others:
Last question, InputBox creates a response box the length of the message. Is there a way to force a 1 character response box?
Thanks, John Graves
======================================================
strReturn = InputBox(lngRecords & ” Records matched the criteria you specified.” & _
vbLf & vbLf & vbCr & _
“Select your choice:” & vbLf & vbLf & vbCr & _
” 1 = Full Record View” & vbLf & vbCr & _
” 2 = Data Sheet View” & vbLf & vbCr & _
” 3 = Print Reports”, “Enter your Choice”, ” “)Select Case strReturn
Case vbNullString
‘strMsg = “Must enter a value, Select an item 1 through 3.”
‘MsgBox strMsg, vbExclamation, Application.NameCase “1”
DoCmd.OpenForm “frm_TOC_BP_ACD”, WindowMode:=acHidden
Forms!frm_TOC_BP_ACD.RecordSource = “qryResultsBP”
Forms!frm_TOC_BP_ACD.Visible = TrueCase “2”
DoCmd.OpenForm “frmqrytblBPermitColSelectedMainForm”, WindowMode:=acHidden
Forms!frmqrytblBPermitColSelectedMainForm!frmqrytblBPermitColSelectedSubForm.Form.RecordSource = “qryResultsBP”
Forms!frmqrytblBPermitColSelectedMainForm.Visible = TrueCase “3”
DoCmd.OpenForm “frmSelectReport”, acNormal, acDialogCase Else
strMsg = “Select an item 1 through 3.”
MsgBox strMsg, vbExclamation, Application.NameEnd Select
============================================= -
WSSupport4John
AskWoody LoungerSeptember 26, 2001 at 2:51 pm in reply to: How to Test InputBox Results (Acc 2000 (9.0.4402) SR-1) #544186Hi Charlotte
Thanks again for proper coding technique, everything works great.
Case Null, vbNullString (generated RTE 94, Invalid use of null)
Case Null (worked OK)
Any thoughts?
Also
InputBox function provides OK & Cancel buttons.
Cancel returns zero length string and vbNullString seems to pick this up.
Is there any way to detremine if user clicks OK without entering a value?
Thanks, John Graves
-
WSSupport4John
AskWoody LoungerSeptember 26, 2001 at 10:56 am in reply to: Change SubForms Record Source (Using Access 2000 (9.0.4402) SR-1) #544125This worked for me
‘ following code changes record source for form from tblBPermit to qryResultdBP
DoCmd.OpenForm “frmqrytblBPermitColSelectedMainForm”, WindowMode:=acHidden
Forms!frmqrytblBPermitColSelectedMainForm!frmqrytblBPermitColSelectedSubForm.Form.RecordSource = “qryResultsBP”
Forms!frmqrytblBPermitColSelectedMainForm.Visible = True -
WSSupport4John
AskWoody LoungerThis is OK
What happens when users leave and new users start using the system? How many hardcoded objects have to be changed? Could be a maintenance nightmare.
With the following code, its all done once in one place by the system administrator
http://www.DataBaseCreations.com has security tools to take security to the control level.
HTH John Graves
-
WSSupport4John
AskWoody LoungerHi Charlotte
What is difference between Security Manager vrs Security Wizard?
Thanks for info, following includes yours, and other references for loungers that might be interested.
John Graves
-
WSSupport4John
AskWoody Loungerhttp://www.DataBaseCreations.com has security tools to take security to the control level.
HTH John Graves
-
WSSupport4John
AskWoody LoungerHi Charollet
Thanks for your help.
Finally got the following is code to work.
Now that it works with hard coded commands, I would like to execute FormField that has the correct command that I dynamically create based on form and control that pops up the calendar.
How do I eliminate the hard code and execute the correct command that I dynamically connstruct in FormField?
Thank, John Graves
=============
Private Function setdate()
On Error GoTo error_handDim FormField As Variant
‘ copies selected date back to active field
ctldate = Screen.ActiveControl‘ the following hardcoded code forces a date field After Upade Event trigger based
‘ on form and control that this popup calendar code was double clicked from
If frm.Name = “frmCriteriaBP” And ctldate.Name = “txtEndReceiveDate” Then
Form_frmCriteriaBP.txtEndReceiveDate_AfterUpdate ‘ this hard coded command works
Else
If frm.Name = “frmCriteriaBP” And ctldate.Name = “txtEndIssueDate” Then
Form_frmCriteriaBP.txtEndIssueDate_AfterUpdate ‘ this hard coded command works
Else
If frm.Name = “frmCriteriaBP” And ctldate.Name = “txtEndExpireDate” Then
Form_frmCriteriaBP.txtEndExpireDate_AfterUpdate ‘ this hard coded command works
End If
End If
End If‘ FormField contains thet correct dynamically created command that i’m hardcoding above,
‘ however I don’t know how to execute the command once constructed in FormField
FormField = “Form_” & frm.Name & “.” & ctldate.Name & “_AfterUpdate”error_hand:
Resume Next
DoCmd.Close
End Function
============== -
WSSupport4John
AskWoody LoungerI have a form with an unbound start date text box that I double click on to popup up a calendar (date picker).
When I click the calendar a date it copies OK into the start date text box, however the After Update Event text box won
-
WSSupport4John
AskWoody LoungerHi Charlotte
After Update Event Won
-
WSSupport4John
AskWoody LoungerHi Mark
This is my code to popup calendar. Not quite sure where and how to code you
-
WSSupport4John
AskWoody LoungerAugust 16, 2001 at 8:15 pm in reply to: Change Forms Record Source (Using Access 2000 (9.0.4402) SR-1) #1787043Hi Mark
Thanks for your reply
Find enclosed another response for your interest.
Specifying a filtername only applies anything found in the WHERE clause of
that query to the existing Record Source — it does not use that query as
the new Record Source. If the query is based on tblBPermit, then it should
work. If it’s based on another table that has a similar field structure,
then it won’t work (I’m surprised it doesn’t give you an error).One way to do it would be to open the form hidden, change its Record Source
property, then reveal it.DoCmd.OpenForm “frm_TOC_BP_ACD”, WindowMode:=acHidden
Forms!frm_TOC_BP_ACD.RecordSource = “qryResultsBP”
Forms!frm_TOC_BP_ACD.Visible = True>
> Change Forms Record Source
>
> Using Access 2000 (9.0.4402) SR-1
>
> I have a form name frm_TOC_BP_ACD that has a Record Source of
> tblBPermit that is used for data entry purposes.
>
> For lookup purposes I have a Criteria form which builds a query,
> qryResultsBP based on desired operator criteria.
>
> I have a button on the Criteria form, which performs the following
> commands:
>
> DoCmd.OpenForm “frm_TOC_BP_ACD”, , “qryResultsBP”
>
> frm_TOC_BP_ACD is opening with record source of tblBPermit instead of
> qryResultsBP.
>
> I’m trying to use one form frm_TOC_BP_ACD for two record sources.
>
> How can I get frm_TOC_BP_ACD to open with record source of
> qryResultsBP?
>
> Thanks, John Graves
>
> 1139nb
> -
WSSupport4John
AskWoody LoungerCan’t you use Mark’s suggestion for the log number, then use an autonumber in the same table to link additional records?
-
WSSupport4John
AskWoody LoungerJune 27, 2001 at 12:16 pm in reply to: Open A Database for Specific Company (2000 (9.0.4402) #530999Mark
Is it good programming to refer to Company & Application as required with the following:
CompanyCode = left( Command(), 2)
ApplicationType = Right( Command (),2) ‘if exactly 2 bytes
Or, should I store them on database open into global variables?
If variables are best, how do I do that?
Does Command hold startup values throughout the session?
John
-
WSSupport4John
AskWoody LoungerHi Mark
I’m using:
“D:Program FilesMicrosoft OfficeMSO2000OfficeMSACCESS.EXE” “d:access2kbuild.mdb” /cmd “01”
=Command() now contains 01, 02, or 03
Now I want to start the project with two fields Company Code and Application Type /cmd “01 RP”
Then I want to isolate 01 in CompanyCode and RP in ApplType as soon as application starts.
Looking for proper location and syntax to break these two fields into Global Variables, Public Const, ??? so they can be referenced in Forms, Reports and Queries while the application is running
What is the best approach?
Thanks, John Graves
-
WSSupport4John
AskWoody LoungerHi Brian
Thanks for your help, I included another soultion for interested parties.
John Graves
Works OK
addr_no_p: IIf(IsNull(Space(9-Len([strLocStreetNo])) & [strLocStreetNo] & ” “),””, Space(9-Len([strLocStreetNo])) & [strLocStreetNo] & ” “)Works OK
addr_no_p: Format([strLocStreetNo],”@@@@@@@@@”) & ” “
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Oracle kinda-sorta tells customers it was pwned
by
Nibbled To Death By Ducks
5 hours, 6 minutes ago -
Global data centers (AI) are driving a big increase in electricity demand
by
Kathy Stevens
15 hours, 26 minutes ago -
Office apps read-only for family members
by
b
18 hours, 3 minutes ago -
Defunct domain for Microsoft account
by
CWBillow
14 hours, 54 minutes ago -
24H2??
by
CWBillow
5 hours, 6 minutes ago -
W11 23H2 April Updates threw ‘class not registered’
by
WindowsPersister
1 day, 2 hours ago -
Master patch listing for April 8th, 2025
by
Susan Bradley
2 hours, 57 minutes ago -
TotalAV safety warning popup
by
Theodore Nicholson
14 hours, 51 minutes ago -
two pages side by side land scape
by
marc
2 days, 15 hours ago -
Deleting obsolete OneNote notebooks
by
afillat
2 days, 17 hours ago -
Word/Outlook 2024 vs Dragon Professional 16
by
Kathy Stevens
1 day, 20 hours ago -
Security Essentials or Defender?
by
MalcolmP
1 day, 23 hours ago -
April 2025 updates out
by
Susan Bradley
4 hours, 34 minutes ago -
Framework to stop selling some PCs in the US due to new tariffs
by
Alex5723
1 day, 16 hours ago -
WARNING about Nvidia driver version 572.83 and 4000/5000 series cards
by
Bob99
1 day, 7 hours ago -
Creating an Index in Word 365
by
CWBillow
2 days, 9 hours ago -
Coming at Word 365 and Table of Contents
by
CWBillow
21 hours, 35 minutes ago -
Windows 11 Insider Preview Build 22635.5170 (23H2) released to BETA
by
joep517
3 days, 12 hours ago -
Has the Microsoft Account Sharing Problem Been Fixed?
by
jknauth
3 days, 16 hours ago -
W11 24H2 – Susan Bradley
by
G Pickerell
3 days, 18 hours ago -
7 tips to get the most out of Windows 11
by
Alex5723
3 days, 16 hours ago -
Using Office apps with non-Microsoft cloud services
by
Peter Deegan
3 days, 9 hours ago -
I installed Windows 11 24H2
by
Will Fastie
1 day, 15 hours ago -
NotifyIcons — Put that System tray to work!
by
Deanna McElveen
3 days, 21 hours ago -
Decisions to be made before moving to Windows 11
by
Susan Bradley
15 hours ago -
Port of Seattle says ransomware breach impacts 90,000 people
by
Nibbled To Death By Ducks
4 days, 5 hours ago -
Looking for personal finance software with budgeting capabilities
by
cellsee6
3 days, 14 hours ago -
ATT/Yahoo Secure Mail Key
by
Lil88reb
3 days, 14 hours ago -
Devices with apps using sprotect.sys driver might stop responding
by
Alex5723
4 days, 23 hours ago -
Neowin – 20 times computers embarrassed themselves with public BSODs and goofups
by
EP
5 days, 7 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.