-
WSsteve_skelton13
AskWoody LoungerFigured out a way to do this. It’s a little strange but I just defined a variable and loaded it with the string information you’d normally type in the formula bar:
<–
Range("c13").Select
IndexRange = "=INDEX('Staffing Numbers Database'!" & a & ",'Staffing Numbers Database'!E1)"
Selection.Value = IndexRange
</–Doesn't invoke INDEX in VB at all.
-
WSsteve_skelton13
AskWoody Loungerthat’s precisely what i did.
thnkx
-
WSsteve_skelton13
AskWoody Loungernevermind. got it.
-
WSsteve_skelton13
AskWoody LoungerFebruary 26, 2003 at 10:16 pm in reply to: Apply a Drop Down box Value to a Cell (Win 2KPro, Office2KPro, Xcel2KPro) #656975I was having problems getting VLOOKUP to work but another lounger suggested INDEX and that seems to do the trick.
thanks for helping!
-
WSsteve_skelton13
AskWoody LoungerFebruary 26, 2003 at 10:15 pm in reply to: Apply a Drop Down box Value to a Cell (Win 2KPro, Office2KPro, Xcel2KPro) #656973Thanks! works fine. I put the referenced cell for the INDEX function on sheet 2 and it worked just fine.
-
WSsteve_skelton13
AskWoody LoungerFebruary 26, 2003 at 9:40 pm in reply to: Apply a Drop Down box Value to a Cell (Win 2KPro, Office2KPro, Xcel2KPro) #656963it’s a combo box from the Forms toolbar set directly on a worksheet. i tried data validation using List and tried to reference the list values used for the drop down box on another page but it doesn’t do anything – it seems to want to look for a list of values on the page holding the data validation cell, which is not optimal for what i am trying to do.
thanks for the quick response! i’ll keep working on it.
-
WSsteve_skelton13
AskWoody LoungerFebruary 12, 2003 at 4:57 pm in reply to: Referencing a control on a subform (Acc 97 sr2 on 95b) #652950thanks for the explanation. still a little fuzzy on what it does as the hidden field on the main form isn’t named anything pertinent to the master/child links. also the secondary subforms use the same Master/Child relationship as the primary subform, which is appropriate as a given client can have the same info (dates and such) on their subforms so the subforms need to be tied to the client ID. I guess, abstractly, the SQL for the secondary subform displays would be
SELECT * from qryWeeklyActivities WeekIDCase = [MondayDate subform].WeekIDCase
with the ClientID/WeekID link already set, this is the needed refinement.
In this case you see I need to reference the MondayDate subform directly on the other day subforms but haven’t had much luck so far. well, must keep banging away…I am concerned with constructing a GUI that gives the end user navigation based on a week chosen and not confuse them with the details.
-
WSsteve_skelton13
AskWoody LoungerFebruary 12, 2003 at 4:23 pm in reply to: Referencing a control on a subform (Acc 97 sr2 on 95b) #652938I noticed this tip when trying to resolve a problem synching records on a tab controlled subform to a record in the main form. The tabcontrol contains 7 subforms, one per tab, for each day of the week. the subform is linked to the main form with a ID number and I need to display the info across a week consistently. I put in a button to add a new week to the subforms; this button goes to each subform and adds a new record then goes back to the Monday subform on the tab control. I have some code that populates the rest of the week dates based on the monday date and was not able to get the new records on the other day subforms to show up consistently after adding the new record.
I inserted the hidden textbox on the main form to reference to the MondayDate on the subform and now the new record information shows up. (previously the new record for Monday shows but the other dates don’t necessarily display the new record even tho it is there) First question: how does this even work? You’re not setting up any filtering or queries or anything, just displaying the subform based on a hidden field on the main form.
I am also trying to accomplish the following: navigate to a given record in the Monday subform. Then click on the tab for some other date and have the appropriate record show up. For example, a single client has three weeks of data in the subform. When you go to the second week in the Monday subform, the Tuesday subform doesn’t follow along. I added the navigation controls to at least make it easy to find the right date but I want to do this automatically. I tried to add a hidden field to the Tuesday subform referencing the WeekIDCase of the Monday subform but that didn’t do anything – displays #Name?
The overall structure is:
ClientID –> ID for main form info
WeekID –> ID for any weekly information for a ClientID
WeekIDCase –> ID for a specific Week in the ClientID-WeekID selectionWhich looks fine to me; the problem is this Tab Control and getting the subforms to respond to changes in the WeekIDCase when changed in the first Subform. I have built each subform on top of a single query so the source is exactly the same; each subform simply displays a subset of the available info in the source query.
Any suggestions? TIA!
-
WSsteve_skelton13
AskWoody Loungerthanks for the demo. turns out i have hacked out a solution of sorts. I have some simple code that visits each page on the tab control and adds a new record. This gives me a new record in the base query with the same WeekID, so I have the one-to-many relationship with ClientID. The basic nut has been cracked. I can now go on…hopefully! now I need to do some additional work on the tab control to help the user know what ‘page’ they’re on if there’s more than one week activity set for a client. been having some problems getting events to trigger when clicking on the tabs on the tabcontrol, but that’s alright. just another day in the life.
thanks for you assistance, all!
-
WSsteve_skelton13
AskWoody LoungerOk, I’m trying to do what you suggested – it makes sense somehow: Placing the main subform on the main form with the basic query as the source would make the main subform a container for the sub-subforms. The basic problem I am having, after all, is simply adding a new record to the tabcontrol. However, I am having many obsticles:
1) the source query has too many fields for it to used as a subform. There are 7 fields for each day of the week plus the WeekID field gives 36 fields and Access chokes when I try to plop the whole query in as the source for a subform. So, I thought, why not just use the WeekID from the source query and have the sub-subforms display the rest of the fields? This doesn’t really seem to work
2) When I place a sub-subform on a tab control, strange things happen. I can set the master/child field on the main subform to ClientID/WeekID; the sub-subform master/child settings look strange in the Wizard: Show for each record in using WeekID. If I ok thru all that, I can’t edit the Linkage parameters – I get an ‘Object variable or With block not set’. I don’t think the nested forms are working correctly, but i’ve never worked with them so i may certainly be missing something.
This is all a little frustrating, because I’d think it’s not a real difficult problem: Access is supposed to allow you to parse out and relate tables. That’s what I’m trying to do with these two tables (Client and Weekly Activities) — but, since the Weekly Activities has a lot of fields, it looks best to use the tab control and, because there’s a memo field for each day, I don’t want to use a datasheet. All I really want to do is add a record to the Weekly Activities as needed and have that new record relate to an existing Client ID as a one-to-many relationship. It’s not hard to make a new record and have the tab-control formatted subforms hook up with a record in Client Info, but it seems devilishly difficult to make this thing add new Weekly Activities in the format I have set up. If I could do this in Datasheet, I think I would have been well on my way to other aspects of the database.
Perhaps your ‘rough and dirty’ example would help – if it can add a new record in the sub-subform that gives me blank fields in the tab control and keeps the same WeekID, that’s exactly what I need: a one-to-many relation between ClientID/WeekID with tab-formatted sub-subforms build from parts of the source query. Could you post it, perhaps?
Also, do you think there’s an issue with the sheer number of fields in the source query?
thanks
-
WSsteve_skelton13
AskWoody Loungerthanks for the response. I went ahead and replaced the DoCmd with RunCommand code and that works also. I kind of like RunCommand because you can tell from looking at it what you are trying to do, rather than calling a menu item by number. Guess it’s just philosophical. I did notice a line in the VB Help that states that RunCommand replaced DoCmd after Access 97, which implies that DoCmd is, so to speak, deprecated. That doesn’t eliminate the error you get when trying to duplicate the form data before selecting a record, which was the original problem. You suggestion to disable the button is interesting; I might want to have the form select a record on open as well — say the first one, to reinforce that one navigates to other records thru the drop-down box. That would be even more intuitive, perhaps.
On the subject of paging up and down on a selected record, I just noticed before getting your reply that this occurs when the Mouse Wheel or Page Down is used and definately don’t want this to occur. I have a sub-field that needs to be tied to a specific record and don’t want users to accidentally scroll into a new record on the subfield. I have it set to cycle in current record in Properties but can’t find anything to answer to the Wheel situation. There is a way to detect PageUp or PageDown and do an event — maybe automatically return to the ‘actual’ record and delete the one just created. It would be better to disable the key totally but help says key events can’t be cancelled. Any suggestions?
I realize this thread is getting off-topic; if you want to move it to something like Subform/Form Navigation Control issues… that’s kind of what I am blathering about. I’m using A2K SR-1 on Win2KPro
-
WSsteve_skelton13
AskWoody LoungerI remembered you saying there have been some problems using the stock Recordset.Clone code when running the Select a Record on a Form wizard when placing a drop-down box. I happen to use this method frequently and was wondering if you could give me more detail on the issue of applying a filter from the combo box.
I am currently working on a project that uses the standard method for finding a record based on the combo box and don’t have any problems with that directly, but I also have a button set to Duplicate Record and, if you don’t select the record using the combo box you get a very basic run-time error that I can’t seem to trap out and use a less obscure warning. The run time error is ‘Invalid use of Null’. I want to replace that with a msgbox saying ‘Please select a record from the drop down box before duplicating a record’ but the Access VB error msgbox always take precedence.
So — actually, replacing the combo box may not help but I am curious as to why you avoid it and would like more details on your substitution.
And, as to the error on the duplicate record routine, I am using the canned Access coding which likes to call menu selections — is that a bad idea? Is there a better way to do it? I get confused by the acCmd and DoCmd and RunCommand options at any rate. But, I would like to not use the kind of code the Wizard likes to use, such as DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70 — it would seem to me that using custom menus or hiding/removing standard ones would cause such code not to work. It just *looks* wrong.
Hope this isn’t too confusing.
-
WSsteve_skelton13
AskWoody LoungerJanuary 17, 2003 at 8:48 pm in reply to: Form/Subform Control Manipulation (2000 SR-1, Win 2000 Prof) #646050Yeah, that works. Thought I’d tried that before but apparently not. Turns out you have to refresh a couple of times for the MondayDate to take and the other dates to take, but the puppy works.
Kudos!
-
WSsteve_skelton13
AskWoody Loungerhaving a hard time visualizing this. I suppose you’ve tried moving the entire tabbed control down from the form header?
I noticed on a tabbed control I am using that it refused to re-size and was wasting screen resources and making the whole form ‘jump’ when setting focus to the tab control. My tabbed control holds sub-forms and the only way to get the darn thing to resize was to open each sub-form and ‘resize’ it’s display (if you play with the window around a form in design view, it keeps that window size in display. Anyway, once I re-sized each subform the tabbed control allowed me to resize it.
A quick way to check if this might be the problem is to open the subforms on their own and see if they are opening in a larger than needed window. then re-size their window display and re-open. Do this for all the subforms, then open the form with the tab control and try resizing it.
-
WSsteve_skelton13
AskWoody LoungerThanks for the reply. I was originally finding problems getting a simple text line to wrap on re-display or print but, mysteriously, that behavior has since vanished. It seems things work fine if you are using text with spaces, like most expected input. Not sure what the problem was. Anyhow, I did spend a lot of time hacking out this function; it still has some utility in cases where you’ve got a long text string with no spaces (such as, perhaps, a GUID concatenation or a long URL reference such as the one on this reply page).
The attached file shows the function and a way to call it via an include file.
![]() |
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
-
WARNING about Nvidia driver version 572.83 and 4000/5000 series cards
by
Bob99
36 minutes ago -
Creating an Index in Word 365
by
CWBillow
8 hours, 48 minutes ago -
Coming at Word 365 and Table of Contents
by
CWBillow
8 hours, 52 minutes ago -
Windows 11 Insider Preview Build 22635.5170 (23H2) released to BETA
by
joep517
13 hours, 48 minutes ago -
Has the Microsoft Account Sharing Problem Been Fixed?
by
jknauth
17 hours, 14 minutes ago -
W11 24H2 – Susan Bradley
by
G Pickerell
19 hours, 10 minutes ago -
7 tips to get the most out of Windows 11
by
Alex5723
17 hours, 11 minutes ago -
Using Office apps with non-Microsoft cloud services
by
Peter Deegan
10 hours, 32 minutes ago -
I installed Windows 11 24H2
by
Will Fastie
4 hours, 29 minutes ago -
NotifyIcons — Put that System tray to work!
by
Deanna McElveen
22 hours, 37 minutes ago -
Decisions to be made before moving to Windows 11
by
Susan Bradley
5 hours, 39 minutes ago -
Port of Seattle says ransomware breach impacts 90,000 people
by
Nibbled To Death By Ducks
1 day, 6 hours ago -
Looking for personal finance software with budgeting capabilities
by
cellsee6
15 hours, 4 minutes ago -
ATT/Yahoo Secure Mail Key
by
Lil88reb
15 hours, 19 minutes ago -
Devices with apps using sprotect.sys driver might stop responding
by
Alex5723
1 day, 23 hours ago -
Neowin – 20 times computers embarrassed themselves with public BSODs and goofups
by
EP
2 days, 8 hours ago -
Slow Down in Windows 10 performance after March 2025 updates ??
by
arbrich
1 day, 10 hours ago -
Mail from certain domains not delivered to my outlook.com address
by
pumphouse
1 day, 16 hours ago -
Is data that is in OneDrive also taking up space on my computer?
by
WShollis1818
2 days, 3 hours ago -
Nvidia just fixed an AMD Linux bug
by
Alex5723
3 days, 19 hours ago -
50 years and counting
by
Susan Bradley
17 hours, 29 minutes ago -
Fix Bluetooth Device Failed to Delete in Windows Settings
by
Drcard:))
20 hours, 17 minutes ago -
Licensing and pricing updates for on-premises server products coming July 2025
by
Alex5723
4 days, 6 hours ago -
Edge : Deprecating window.external.getHostEnvironmentValue()
by
Alex5723
4 days, 6 hours ago -
Rethinking Extension Data Consent: Clarity, Consistency, and Control
by
Alex5723
4 days, 6 hours ago -
OneNote and MS Word 365
by
CWBillow
4 days, 8 hours ago -
Ultimate Mac Buyers Guide 2025: Which Mac is Right For You?
by
Alex5723
4 days, 8 hours ago -
Intel Unison support ends on Windows 11 in June
by
Alex5723
4 days, 8 hours ago -
April 2025 — still issues with AMD + 24H2
by
Kevin Jones
2 days ago -
Windows 11 Insider Preview build 26200.5518 released to DEV
by
joep517
4 days, 20 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.