473,395 Members | 1,702 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Using Sub Forms to select Main Form records

What is the best way to have a continuous sub_form pick the record that the main_form is showing. (same table/query)

bookmarks? find_records?

also if the main form changes record have it change the sub_form selection.

i have tried the following code:
Expand|Select|Wrap|Line Numbers
  1.     Dim rst As Recordset
  2.     Dim strCriteria As String
  3.  
  4.     Set rst = [Form_Item].RecordsetClone
  5.     strCriteria = "[Inv ID] = " & [Inv ID]
  6.     rst.FindFirst strCriteria
  7.     If rst.NoMatch = False Then
  8.         [Form_Item].Bookmark = rst.Bookmark
  9.     End If
  10.  
  11.     Set rst = Nothing.
Which "sorta" works. It will work once, then wont, then will. Which is weird.

I used to do this easily with a combo box, but i want color changes, so i need a subform.

Im trying to have two subforms control the record.
The 1st subform has ALL the records
The 2nd subform has records associated with the current.
Oct 28 '15 #1
2 882
NeoPa
32,556 Expert Mod 16PB
I'd use a filter myself.

Unfortunately, I find the question very unclear as you don't explain which of the items you include in your code refer to which items in your question. The question has a 'Main_Form', but the code doesn't. The most important part of the code would be the procedure header, as that would hopefully give some clues, but that part is strangely omitted from the question.

Look, I understand that formulating questions clearly is much more difficult than you'd guess until you try it, but this could be made a lot clearer by considering what information we need and explaining it consistently.

For what we have here though, I would recommend using the selected record of the subform to set a filter in the main form.
Oct 28 '15 #2
zmbd
5,501 Expert Mod 4TB
Let me see if I understand:

Are you developing/emulating a "Split Form:"

The main form would have an "Index Card" style format wherein one can see the all of the information in the record fields; whereas, the table would show the same information; however, not in such an easy to read format.

Is that correct?
Oct 28 '15 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Vladimir Oľura | last post by:
I am building a Pocket PC application in C#. I have 5 forms (1 main and 4 sub forms). The main form must always load first. The sub forms are loaded from the main form. The application is run...
0
by: theBman | last post by:
I have 2 tables. One master, one child using Access 2003 (PC) Have 2 forms. The main form is continuous while the sub is datasheet. I can filter on the main form and the subform filters with...
2
by: SREDWORB | last post by:
Hello, Try to explain this as best as I can. I have a main form with several cmd buttons, (Not interested in subforms for this project) that opens popup forms. Example: Main form frmPerson,...
4
by: Nunu | last post by:
Hi there. this is what I have... listview on mainform named lstViewFrmMain, 1 textbox and a button on frm 2. My question is, how do I update the listbox when a user clicks button on the 2nd...
1
by: Moish | last post by:
I have a form that does not have any bound fields. I want to open a subform on that form to a specific record based on the value of an unbound field on the main form. Obviously the subform is not...
7
by: rleepac | last post by:
Newbie here...I've been reading these forums for hours and I'm learning so much! I'm a Physician Assistant by trade but necessity has converted me to a pseudo-Access db designer. I have a db that...
1
by: Gordon Padwick | last post by:
I’m still having a problem with using a combo box in a main form to select records to be displayed in a subform. I’ve tried code suggested in several sources, but it doesn’t work. In “Filter records...
0
by: Jan Grib | last post by:
Hi There, Hope someone could help me out with the following. I am building a Timesheet where I use my Main Form to add Names, Times etc., and then use a subform next to it as a preview form. The...
1
by: Shahich | last post by:
Dear Sir, One toggle link (child form) automatically attached with main form through form wizard. I wanna link more 10 forms with main form as child forms. How can I do this. Please guide. Thanx &...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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...
0
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
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
jinu1996
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.