Get To A New Subform Record From A Separate Form

May 30, 2006

Hi,
I think what I want to do is simple but I can't figure it out. I've tried searching the forum for the solution but I'm having trouble with what I've found. Here's what I'm trying to do: I'm composing a text string on one form (recipe ingredient) and, once it is complete, I want to add it to the records in a subform on a separate form (the recipe). The string composition works great, and I can use:

Forms!frmRecipe.fsubIngredients!txtIngredient = Me.txtEntry

to paste the string into the textbox on the subform. The problem is "finishing" the record in the subform. When I prepare a new string for the next ingredient, it copies over the previous string. So, I'm not moving to a new record in the subform. I've tried:

DoCmd.GoToRecord , "frmRecipe!fsubIngredients", acNewRec

but Access tells me the form isn't open, which isn't true.

So, what I want (I think) is a way to direct the subform to move to a new record before I paste in my text string. Or, to direct the subform to move to a new record after I paste in my text string.

By the way, the subform has a before insert event that copies in the record id of the recipe for the new record holding the inserted text string, so the table relationships will be fulfilled:

Private Sub Form_BeforeInsert(Cancel As Integer)
Me!lngRecipeID = Me.Parent!lngRecipeID
End Sub

I'm pretty sure I'm missing something simple here, and I really appreciate anybody's effort to help me get it right.

Thank you!!!

View Replies


ADVERTISEMENT

Forms :: Find A Subform Record From A Separate Pop-up Form Based On Its ContractID?

Apr 24, 2014

I'm trying to find a subform record from a separate pop-up form based on its ContractID. When I click the button, I get the following error:

"A macro set to one of the current field's properties failed because of an error in a FindRecord action argument."

When I step through the code, it works just fine. Here is my code:

Code:
'Find contract
With Forms!frmContractForm.frmContractSub
.Form.ContractID.Enabled = True
.SetFocus
.Form.ContractID.SetFocus
DoCmd.FindRecord Me.ContractID
.Form.Business.SetFocus
.Form.ContractID.Enabled = False
End With

View 1 Replies View Related

Refresh Subform From Separate Form

Nov 23, 2012

I have a form called frm_Incident_Single. On this form I have a subform/subreport called tbl_Incident_Apps_subform. I have a command button on frm_Incident_Single that opens another form called frm_Incident_Apps where I choose multiple selections. When I save or close the form I would like to update the subform - tbl_Incident_Apps_subform.

I've tried to requery/refresh the subform in the save procedures in frm_Incident_Apps but when I save it, I get a syntax error. Here is the line of code:

Forms!frm_Incident_Single!tbl_Incident_Apps_subfor m.Form!Requery

I've tried many variations and can't get it to work. How I can refresh the subform?

View 3 Replies View Related

Forms :: Filtering A Subform On Tab Control From A Separate Form

Sep 11, 2013

I am trying to filter a subform on a tab control based on an input on a second form.

Mainform: frm Index Page 2
Tab Control on Mainform: tabctrlMain
Subform: Customer Details
Tab Name: tabCustomerDetails

The second form is basically a separate Search Form where users can look for a customer ID and returns the ID back to Customer Details form.So far I have managed to redirect focus to the correct tab on the tab control using the following code:

DoCmd.OpenForm "frm Index Page 2"
With Forms("frm Index Page 2")
!tabctrlMain.Value = !tabCustomerDetails.PageIndex
End With

However, I am stuck with the filtering part. Everything was working fine before I began putting the forms together into one big tab control (I tried using Navigation Pane but there were too many referencing problems so I gave up on that one).

View 2 Replies View Related

Forms :: Open A Form With Subform From Separate Form

Oct 23, 2014

I'm trying to open a form with a subform from a separate form. I've never had any issue before, but all of the sudden, the subform doesn't seem to open immediately. I get the error

Code:
Method 'Form' of object '_SubForm' failed.

After that, it opens (subform and all), but some calculated text fields just say "#Name?#"
The only thing I did today was add a command button to that subform.

When I try opening the form (or subform) from the navigation pane, I get

Code:
The expression On Current you entered as the event property setting produced the following error:

A problem occurred while Contracts was communicating with the OLE server or ActiveX Control

When I step through the code, it doesn't reach the On Current event.

View 5 Replies View Related

Modules & VBA :: Print Preview Button On Main Form That Previews Current Record In A Separate Report

Jan 25, 2014

I have VBA code for a Print Preview button on the main form that previews the current record in a separate Report using this code:

Code:
Private Sub cmdPrintRecord_Click()
Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

[code]....

I use this Print Preview code on a Button in the Form Header. The Main form lists head of household information. I also have a tabbed control with three tabs that have SubForms for Address, Children and Contact details. The problem I have is that if any of the subforms are left blank I get a Run-Time Error '3021': No Current Record. If I Debug (press the button), it takes me straight to this line:

Code:
varAge = DateDiff("yyyy", varBirthDate, Now)

highlighted in Yellow.Anyone on my database must have an address, should have contact details and could have children. If any one of these is blank then the print preview will not work.I would like to know how to stop this error happening for blank records in my subforms.

View 11 Replies View Related

Reports :: Open Separate Reports For Each Record In Continuous Form

Aug 19, 2014

I have a continuous form that displays a list of invoices (frmInvoiceList) based on an adjustable filter contained within the form. I have the filters working the way that I want them through VBa and I have a button on each record to open a report (rptInvoice). Inside that report, I have some controls to "print", "email", and "export to PDF". Again all that works just the way I want. The Form and the Report are based on a different query and each has an InvoiceID field to link.

What I am trying to do is put the Print, Email, and Export buttons on the main form which would perform the appropriate action for all the records that are displayed on the form. I've been able to get the Print function to work to a degree. It will print all the records, but it changes the background colors based on the alternating records. When I go to Email or Export, it creates a single file with multiple pages and each page is a new record, again with the alternating background colors.

Ideally, I would like to have a separate file exported for each record that can be renamed and archived separately. I'm not so concerned with the email function but if it would be possible to generate a separate report for each invoice, then pull the appropriate email address for the record, that would be really nice.

I've tried some "for" and "do" loops that I found through some Googling but none of the samples ended up working like I wanted.

View 10 Replies View Related

Forms :: Main Form Jumps Back To 1st Record When Moving To Next Record In Subform?

Mar 24, 2015

When I add a record in the subform and then move to the next record whilst still in the subform, the main form jumps back to its first record? I then have to move back to the right record in the main form to update the next record in the subform.

I want to move to the next record in the subform without affecting the main form.

View 1 Replies View Related

Forms :: Open A Form For Adding Child Record Related To Highlighted Record In Subform

Oct 2, 2013

Is it possible to open a form to add a child record related to the highlighted record in the subform?

View 2 Replies View Related

Open Record In Main Form By Clicking Record ID In Subform

Dec 16, 2014

I am creating an events database. In my main form, I have all the details of a single event (billing code, fees, customer, support personnel, etc.). Then, I have a subform (form view) that lists each of the other services which share an event ID (this ID comes from a separate, unrelated events management suite). In the subform, I display the most-commonly-edited fields so that they are editable without navigating to a different record.

However, there will be instances where it becomes necessary to navigate to one of the records listed in the subform. I would like to make this a quick process by just clicking on the primary key in the subform, and have the corresponding record appear in the main form.

In my searches I've found a common suggestion to use a DoCmd.OpenForm method where the form opens to that specific record -- in effect filtering by the primary key number. I don't prefer this method because it disables the ability to navigate to other records using the previous, next, find records, (etc.) buttons without closing and re-opening the form.

Is there a way to make the main form 'jump' to a specific record by clicking on a control in the subform, without limiting the ability to navigate in the main form?

View 10 Replies View Related

Export Each Record To Separate Text File

Jun 30, 2005

I would like to export each record of an access table to a separate text file and use one field of each record as the source for the file name of each exported text file.
Does anyone know a way of dong this?

View 3 Replies View Related

How To Print Each Record Of A Group On A Separate Page

Oct 23, 2004

I have a report with field "Plot" as Group Header. I need to print the report
which lists the owners of each Plot. When the number of owners is large, it takes more
than one page for the listing. How can I force a new page for each new Plot ?

View 2 Replies View Related

Reports :: Create Separate Report For Each Record

Apr 13, 2013

I have a query which displays only the records that match the criteria in the form given before. Now i want to create separate report for each of these records. How should i go about with it? I don't want a seperate form for this purpose, is there any way to do the same with a macro?

View 1 Replies View Related

Update Separate Table When Record Is Edited

Aug 5, 2015

I have a form where a user can change the scheduled start date for a job. On a sub form on the same screen is a list of notes relating to that job.

Any notes added, automatically have todays date and are locked when the user clicks off.

When the scheduled start date is changed I need a note to be made. Either forced, then entered by the user or automatically.

I was thinking of making the scheduled start appear in a small form and the button to make it come up could add a new note on the click event (possibly in a message).

Or even better (probably harder) any time the value is changed in the form a new note is added.

Other options could be a pop up form to add one note on a change.

View 4 Replies View Related

Automatically Exporting Each Record To Separate Text Files

Aug 23, 2007

Hi all,

I've seen a lot of repeated questions from newbies about exporting to text, but so far I haven't come across a scenario like mine. Apologies if I've overlooked something.

I'm using Access 2003 and I have a database that contains a record for each article that appeared in a certain newspaper over the last 30 years (~70,000 records). Each record has a field for year, month, issue, page, title, and text. The text field contains multiple lines of HTML as well as the text of the article itself -- the program designed for viewing these articles calls on this field to create an html document that resembles the original newspaper page in the GUI.

What I would like to generate is a separate .TXT file for each article containing just the text of that article and a filename system that identifies each file by year, month, page, and possibly title (i.e., about 70,000 separate text files). I'm not sure if I want the title within the document or just in the filename, but I'm assuming that wouldn't be difficult to change.

In other words, I'm trying to work backwards, reconstructing the text files that the person who made the database probably has sitting on a disk somewhere (but I don't have access to).

I've read about using the TransferText method, setting up an export spec and looping it in VBA, etc., but the closest solution appears to be Microsoft's page on exporting records to separate HTML files (http://office.microsoft.com/en-us/access/HA010345961033.aspx), which mentions: "You can create a Microsoft Visual Basic for Applications (VBA) program that enumerates through the record set and uses the PRINT statement to output each record as a separate HTML file." After doing this I guess I would batch convert from HTML to TXT. Unfortunately I am new to Access and don't know VBA.

Can anyone provide any suggestions?

Thanks,
Jim

View 4 Replies View Related

Create New Record & Pass Autonumber To Separate Table

Mar 10, 2008

I have a form, frmSub, that contains the combo box comProducts. I also have two tables, Products and PurchaseDetail. Both tables have the field ProductID.

I want comProducts to create a new record in the Products table, using the input in a field called Product and then to use the value of ProductID to create a new record in the PurchaseDetail table. Ie, so the PurchaseDetail table has a record that links to another record in the Products table via the feild ProductID.

I hope I was semi-clear.

View 4 Replies View Related

Modules & VBA :: Write Separate CSV File From Each Record In A Table

Jun 22, 2015

I have the requirement to write EACH record from a table to its own CSV file with name of the file being combination of 2 fields

So let's say I have Table1 with 3 columns (Field1, Field2, Field3) with following content :

Field1 Field2 Field3
AA 1 ABC
AA 2 DEF
AA 3 GHI

I should get 3 files with names AA1.CSV, AA2.CSV and AA3.CSV and each file contains its respective row from the table.

I tried to do it with DAO Recordset, but I do not find a way to write only the current record from recordset while looping.

See below the code I was using, but issue is that code does succesfull creates the 3 CSV files as per above example, but in each file it writes ALL 3 ROWS instead only the respective ROW.

Code:
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim strSQL As String
Dim strFilename As String

[Code] ....

View 10 Replies View Related

General :: Simple Audit By Posting Whole Record To Separate Table?

Jul 30, 2014

I need a simple audit capability

I have a table (Called Master Active List)

I have an empty duplicate of it called History of Master Active List. (Identical fields, with the addition of a distinct ID (primary key)

I have a form where the master can be changed (Called customer details)

When any change is made I want to post the whole record to the history table

1 - Am I correct I no longer need a form based one,(office 2013) and can do one on the data table itself?

I want to capture everything, can this be done with a wildcard, or do I need to go line by line?

The master table has a ton of fields.

View 3 Replies View Related

Modules & VBA :: How To Publish And Save Each Record Report In Separate File

May 24, 2014

Trying to make this code work, don't know how to filter as it prints identical all reports.

Private Sub cmdExportPDF_Click()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim MyPath As String
MyPath = "C:Reports"
If Len(Dir(MyPath, vbDirectory)) < 1 Then
MkDir (MyPath)

[code]....

View 14 Replies View Related

Tables :: Way To Separate Data In The Cell Into Separated Cells In A New Record?

Jan 21, 2013

I use a Access database to import data from an email generated from google docs..When the data imports to the table it creates a "Memo Field" with several lines of carriage seperated data containing the Form Field name & answer. (ie: Firstname=John, Surname=smith, etc)Is there any way to seperate this data in the cell into seperated cells in a new record?

View 1 Replies View Related

Forms :: Highlight Unbound Subform Record That Matches Other Subform Record

Jan 22, 2014

I have two unbound unlinked subforms residing on a 3rd unbound main form. When I enter the current record on Subform1 I would like the matching record(s) on Subform2 to be highlighted or otherwise formatted. I can get this to work for only the first record on subform2 due to the way I have my code setup on Subform1:

Code:
Private Sub Accounting_Unit_Enter()
'find where AUs match. only works for first Subform2 record
If Me.[Accounting Unit] = Forms!MainForm.[Subform2]!AccountingUnit Then
msgbox "Match"
End If
End Sub

My thought was that I needed to reference the Recordset of Subform2 and search for all AccountingUnits that match the current AccountingUnit of Subform1,

View 6 Replies View Related

Queries :: Appointment Database - Query Most Recent Entry For Each Record In Separate Table

Jun 20, 2013

I have a database that is used to allocate appointments to our staff. It has 2 tables, one that lists the clients we need to call in that day, and another that stores details of each contact attempt. I'd like to design a query that find all clients who we have not dealt with so we can easily get their details in a list. I know what the criteria for the query would be, but I'm stuck for how to actually execute it. Here are the details.

Table tClients stores the current clients - primary key is named "clientRef"
Table tContactEvents stores each contact attempt and the date/time is stored in a field named "dateTime".

When an entry has been dealt with successfully a yes/no field named "completed" will be set to "Yes".

There may be many attempts to contact a specific client on a given day, unsuccessful attempts will not have the completed flag set.

Once the completed flag is set that client will be ignored so no further entries will appear.

So I need a query that searches tContactEvents for the most recent match to each number in tClients.clientRef and checks if the completed flag is set. If the completed flag is false, or if the number has no match (i.e. no contact attempts made yet) then the clientRef should be displayed. I also need this to be restricted to the current date, as the same client could have rebooked their appointment to a different day.

View 10 Replies View Related

Delete Record In Form With Subform

Mar 15, 2006

I amd having trouble putting a delete cmd button in a form that has a sub form on it. The errror reads "the record cannot be deleted or changed because table "details" includes related records".

View 3 Replies View Related

Open A Form And A Subform On A Specific Record

Mar 7, 2006

I am trying to open a single form with a single subform with a command button. I would like to open the form with the subform on a specific record but I am not entirely sure how to do this, I was wondering if someone had any advice that could help.

View 2 Replies View Related

Creating New Record In Main Form From Subform

Aug 4, 2005

Hi,

I want a user to be able to create a new record in the main form, after they have finished filling in the boxes in a subform by pressing the Enter key, rather than having to click the 'new record' button on the main form.

I reckon I need a 'default button' on the subform but I have no idea what this should do when clicked to create the new record...

View 1 Replies View Related

Form/subform Adding New Record Problems.

Oct 27, 2005

Hey everyone, This seems like a great community for access - I'm glad I stumbled across here because I have some issues that need figured out.

I've searched the forum for answers and I have found a few posts with suggestions, but nothing has worked yet. (by the way, I'm fairly new to access, but not to databases in general).

So here's my problem, and I appreciate any help in advance.

- I have a main form and 2 subforms on the main form. The main form contains the information of thousands of Titles to different sections of land. The one subform then has multiple "requirements" per Title. So i have a many-1 relationship between the requirements and titles. On the main form, there is an edit button - so everything is locked until the user hits the edit button, and then the main form becomes editable. The requirements subform does not - it stays locked even though in my code I have "Me![Requirements Subform].Locked = False"

But this is not my main concern right now. What gets me is that I can not add a new record from the requirements subform. For example, Title 1 (T-0001) has 11 different requirements. I can use the navigation to browse through the requirements but I can not add a new requirement from the navigation buttons. This is a main concern.

Another main concern is that when I add a new Titles record from the navigation buttons, my requirements subform disappears from the form.

I hope I explained my situation clearly! if anyone needs any clearification, let me know.

Thanks again,
Brandon

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved