I have designed a form(main form) which has a record source that runs subforms. this works perfectly. I also have a macro that is attached to this subform which filters records on a different form. One of my subforms contains personnel IDs and few details. When I click on the ID field the macro runs and opens another form, filtering it by the ID number. This works when the subform is opened independently but when the subform is opened on a record source frame and you try to click on the id field you get an error message that Ms access can't find the subform referred to in a macro.
How can I filter using a code? I tried using DoCmd.penform command and it works, but I fail to come up with code that can pick the id number from the subform and opens the other form filtering it by the same ID. I need help.
6 1456
In general when wanting to have two subforms synchronized I use a (hidden) textfield on the main form.
In the first subform I add in the OnCurrent event a line like: -
Parent.txtPersID = Me.PersID
-
This will fill the proper ID, next I link the other subform (just single click to get the LinkageFields property) to this txtPersID and when changing the first subform's row, the other subform will show the related Persons record.
Getting the idea ?
Nic;o)
Nic;
i do get the idea and i know this would work with subforms..but what iam trying to do is to open a new form from a subform not opening another subform. so i dont know if the Parent. expression will work.
NeoPa 32,556
Expert Mod 16PB
Dan,
What Nico has posted covers forms, subforms and their interrelationships well, but if as you say, you are working with a form which is separate from the current form, but invoked by that same current form, then you simply need a reference to that separate form. If the separate form was invoked from code within the current form then it must know the name of that form at least, if it doesn't maintain an object reference to it. Using an object reference is even easier of course, but if only the name is available then Forms({Name}) gives the same reference to the form. From there what you want to reference is down to you (and should be pretty straightforward).
If Text_EmployeeID is the name of the textbox that contains the employee Id in the subform and Frm_Employee_Details is a form that displays the details about an employee, i have used: - DoCmd.OpenForm "Frm_Employee_Details", , , "empID=" & Me.Text_EmployeeID.Value
but i get a data type mismatch error 3464.
thanx i managed.... hope you guys enjoy your day
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Aionius |
last post by:
Good day to all.
I have this problem in JavaScript. I have a form (textbox) which
accepts a series of numbers in format 9999-9999-9. Now i want to
filter all inputs to the textbox. let's say...
|
by: CSDunn |
last post by:
Hello,
I have a problem with field filtering between an Access 2000 Project form
(the application is called CELDT), and the report that shows the results of
the filter. Both the form and the...
|
by: Nathan Bloomfield |
last post by:
Hi All,
I am hoping someone out there will be kind enough to find out where my
code is going wrong. The current code is inefficiant but hopefully it
will convey the data I require to be...
|
by: Aravind |
last post by:
Hi folks.
I have a form, frmHistory, which has 4 command buttons: Sort Title
(cmdSortTitle), Sort Name (cmdSortName), Due Today (cmdDueToday), and
Due List (cmdDueList).
Sort Title and Sort...
|
by: Aravind |
last post by:
Hi folks.
My database project has the following:
--------------------------------------------------------------------------------
tables:
Member: MemName, MemNo , MemType, CourseFaculty...
|
by: Sean |
last post by:
Greetings all,
I am attempting to make a form that will filter through several tables
that
(I believe) have refretial integrity. I am pulling data from several
tables into the form and i would...
|
by: Dave |
last post by:
I am having difficulty filtering a form as the user types in a onchange
event
here is my code
strFilter = cboCriteria.Value & " LIKE '" & Me!txtCriteria.text
& "*" & "'"
If Len(strFilter ) 0...
|
by: hlebforprimeminister |
last post by:
Hi
I want to filter records on a continuous form(FRM_SUPPT) by one of the fields, SW_ID.
FRM_SUPPT has a text box ( bound to SW_ID) and two drop-down lists that are bound also. The three...
|
by: novoselent |
last post by:
This seems like it should be an easy thing, but I think I'm missing something simple here...or I'm just going about it all wrong...
Using Access 2003
I have a form that lists vehicle service...
|
by: David Davis |
last post by:
Hello,
Ran into a snag while building my database. I have several forms but lets work with two for right now; Form1 and Form2 both have the same fields but use by two different users but both are...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |