Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Trying to get form/subform combination to work

Posted on 2011-03-16
3
Medium Priority
?
320 Views
Last Modified: 2012-05-11
I posted a question a while ago, but never really got it resolved:
http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_26846767.html

I probably failed to give enough information and clarification, so I'll try again.

I am trying to find an easy way for our Accounting team to report to our Sales Manager all of the expenses we incur.  He can then assign each expense to a particular Account.  I have the first part down, where Iink, via QODBC, to Quickbooks via an Access DB, then create/append a table in another database.  I take one more minor step in a query where I reduce the specific detailed accounts to a general category.  (For example, instead of having Travel:Meals, Travel:Lodging, etc., I just map them all to "Travel")

Okay, so my goal is have two separate subforms on one page (or one if that's possible).  I want the user to be able to scroll through a datasheet view of the query, which lists all of the records, but adds the more general category instead of using the account name/number used by Finance & Accounting.  When the user selects a record, I want the other form to show in form view the same record from the original table.  He can then edit a field, adding the account number to which we'll assign this expense.

It was suggested that I used the following code in the first subform, which I assumed was the datasheet one, but I could have been wrong.
 
Private Sub Form_Current()
Dim rst As DAO.Recordset

Set rst = Me.Parent.Subform_OrigExpnes_a.Form.RecordsetClone

rst.FindFirst "txnLineID='" & Me.TxnLineID & "'"
If Not rst.NoMatch Then Me.Parent.Subform_OrigExpnes_a.Form.Bookmark = rst.Bookmark
End Sub

Open in new window


I'm getting an error: 2465 Application-defined or object-defined error
Screenshot Attached.

Can someone walk me through what I might be doing wrong?
0
Comment
Question by:BBlu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 21

Accepted Solution

by:
Boyd (HiTechCoach) Trimmell, Microsoft Access MVP earned 1400 total points
ID: 35152635
It sounds like what you need is what I call cascading sub forms.

The simplest method I know uses no VBA code. That's right no code.  Place a hidden text box on the main/parent form that has a control source that references a control on the first sub form that has the primary key value used to identify the record to show in the second sub form. The second sub form uses the text box as the master linking field.

0
 

Author Comment

by:BBlu
ID: 35153010
Uhh, okay.  LOL.  I'll try that.  Thank you very much.  I'll let you know if/when I run into any stumbling blocks.
0
 
LVL 21
ID: 35153077
Unfortunately I can't be any more specific to your needs since you have not given use any detail about your database.

Let me know if an example would help.


0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question