Opening Forms (that Is Related To Same Record)

Feb 1, 2006

I have 3 forms.

I open the very first one (main form). From there, I wrote a little VBA in the 'Add Record' button that if a certain checkbox in that form wasn't checked when I click 'Add Record', it would open up the 2nd form.

The problem is, when I open up the 2nd form and enter info, the info is all put into a new record.

I want the 2nd form's info to go into the same record as the main form. It's all related.

How do I do that?

Note:I built the 2nd and 3rd form from queries that had parameter querying in them...the parameters are frmo the main form.

View Replies


ADVERTISEMENT

Forms :: Split Database - Opening Related Record On Different Form

Aug 11, 2014

I have a split DB that is in its (hopefully) finally stages of development. Using Access 2010. It is being developed both at work and at home on a 64 bit machine. The remainder of the machines are 32 bit.

All of a sudden one of my most basic sets of code doesn't want to work, but only on my machine at work. It works fine on my home computer and on other computers at work. It is the simplest of codes, run from frmNameA:

DoCmd.OpenForm "frmNameB", acNormal, , "[SequenceNumber] = " & Me![SequenceNumber], acFormEdit, acWindowNorm

The desired sequence of events is to open frmNameA, find the active clients and then click on the [SequenceNumber] to bring up the related record on frmNameB.

When I do this on my computer at work, it asks for the query criteria for the [SequenceNumber] and the criteria for another field. On the home computer and others at work, it works just fine.

In a related problem, I have the following code on the OnLoad event for frmNameB. It opens all the related records for active clients that are in frmNameB. But if there are no related records, it is supposed to cancel the event. Again, it works fine on my home computer and others at work, but not my work computer.

Private Sub Form_Open(Cancel As Integer)
'code when opened from frmNameA and no record exists in frmNameB
Dim MyReply
If ClientID = "" Or IsNull(ClientID) Then
MyReply = MsgBox("No record exits in frmNameB, Do You Want to Exit?", vbOKOnly)
If MyReply = vbOK Then
DoCmd.RunCommand acCmdUndo
DoCmd.Close acForm, "frmNameB", acSaveNo
End If
End If
End Sub

What I can't figure out is why this may be happening, where I might look for errors, and what I might do to correct this.

View 9 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

Forms :: Cannot Add Or Change A Record Because A Related Record Is In Table

Feb 22, 2015

I have created three tables, all of them are connected by one-to-one relationship by same field, as you can see in the screenshot. and at the same time I have created three forms for each table. then I brought two forms in one remaining form. so whenever I entered data in first form and click on the next tab in which another form exist, it gives me this error: "you cannot add or change a record because a related record is in table".

View 2 Replies View Related

Forms :: Relational Database - Add More Than One Name To Related Record

Aug 23, 2013

I have a simple relational database with the proper linking tables, etc. I am normalized through BCNF. I have a table that will track tasking details, however, more than one person is assigned the tasking. How do i add to my form the ability to add additional people to the tasking?

If I drag and drop the name field then it is a one name for one box deal. I want to create a combo box that uses a query to prepoulate multiple elgible names (already built) and then you can select the person you want. Afterwards I want the task assigner to dynamically add additional people to the task with no true limit as the group can be as small as one and as large as thirty.

I attached a small screenshot of the basic table structure. I need to be able to add multiple SME's to the one tasking...

View 2 Replies View Related

Forms :: Form Data To New Record Related Table

Aug 19, 2013

I have a form based on a table which includes the mid field. I want to have a macro that takes the value of the current mid, and makes a new record in a 1-many related table (consisting of record id (auto), mid and trmntdate), paste the mid and insert the current date.For the life of me I cannot get it to work? The process should be something like:copy mid value, add new record to related table, paste value in mid, insert current date in trmntdate, save. I've tried append queries, experimented with copy etc, dabbled blindly with VBA and not got anywhere.

View 14 Replies View Related

Opening Form2 With Data Related To Form1?

Jun 30, 2005

Hi,

I've searched but cant find the answer,

I have an Account form (Form1) and it displays account information along with their many addresses for the account (in a datagrid embedded form). I hit "update or add address" button to launch form2 (Address Form). From this point I want to query the Address and AddressAccountLink table with a passed in Global Variable (AccountID) from Form 1 so that just the Addresses pertaining to that Account show up, instead of all the Addresses for all accounts.

How do I do this? I've tried a String Query in the Private Sub Form_Load() but it gives me errors, here that is:
sSQLQueryAddr = "SELECT tblLinkAccAdd.AccountID, tblLinkAccAdd.AddressID, tblAddress.* FROM tblAddress INNER JOIN tblLinkAccAdd ON tblAddress.AddressID = tblLinkAccAdd.AddressID WHERE (((tblLinkAccAdd.AccountID)=" & v_accountid & "))" (it's on one line in the code)
followed by:

DoCmd.SetWarnings False
DoCmd.RunSQL sSQLQueryAddr
DoCmd.SetWarnings True

Any ideas? Am I on the right track? Do I move this query elsewhere? The address form is made from a query -- querying the Address and address/account link table.

Oh, the v_accountid does have the correct value passed to it...

Please help , I'm going nuts here!! :confused:

Mike

View 12 Replies View Related

Forms :: Update Record Based On Combo Box Choice And Related Tables?

Jun 3, 2014

In my database I have a table that keeps track of a package of items. The package is assigned a package type (counter display, end cap, half pallet, full pallet for example). The record of the association of the package and it's type is held in the main table.

Each of these package types is either a case or a pallet (counter display and end cap are cases and half and full pallets are pallets) This relationship is kept in another table (we will call it description table).

Now, based on the type of package and therefore it being a case or pallet a UPC and a GTIN number are assigned. The GTIN number is different if it is a case or is a pallet. I have a table that stores all of the UPC and GTIN numbers available in 3 columns, one for UPC, one for GTIN Case and one for GTIN Pallet (the UPC is a standard 12 digit and the GTINs are 14 digit -with the first 2 different to designate pallet or case. and all are based on the check digit formula necessary)

The user assigns the UPC and correct GTIN number by clicking a button which applies the next available UPC code to the package and determines if the description of the type (case or pallet) and inserts correct GTIN number into that field. I actually have all of this functioning correctly.

Now the problem. If a user changes the package type, and therefore changes the description, I need to add code to the update event of the combo box that gives the choices for package type that does the following:

Check to see if the original package type was a case or pallet (it's description) and if by changing the package type it is now changed to the other, update the record in the main table to the correct GTIN number based on the existing UPC Code.

OR as I write this, maybe the code could simply update the main table with the correct GTIN code based on the new description and the existing UPC code. This was I would not need to check for a change just do the update every time.

View 14 Replies View Related

Forms :: Link To Open Form With Certain Record Related To Individual In Query

Dec 5, 2013

I created a query that shows everyone who has a specific date field blank. Now want to make those names clickable so that it opens a specific form with a certain record related to that individual in the query. Each line with a different individual should open a different person on the form and their corresponding record.

View 3 Replies View Related

Forms :: Opening A Form At A Particular Record In Set

Feb 8, 2015

I have a table with a schedule of tasks that are required weekly for the next year. Each record has Monday's date as the Scheduled_Date" for the task. From my main form, I have a command button to open a form linked to the table, so that amendments can be added to the table for each record (i.e. - If a task is complete/incomplete/progressing etc. the user marks it so.

What I would like to do is have the form open at the task scheduled for the current week, based on the "Scheduled_Date" value. Whilst I can do this with a simple filter, I would like the form to open with all records available to the user so that they can go forwards/backwards as they wish, but the first record they see when the form opens is the one specific to this weeks date.

View 4 Replies View Related

Opening Forms Blank Ready For Add Record

Dec 30, 2004

I was reading some other posts and someone said they got their Forms to Open ready to accept data, just curious how to go about this...

View 4 Replies View Related

Opening Forms And Unwanted Record Advancing..help..please!

Apr 3, 2007

Hi all,

Ok, this is a seemingly VERY simple problem gone haywire!

I have a very simple database that gathers data from 50 questions. It stores these in fields as numbers (1 - 10). no problem.

However, I've had to split the questions over 3 forms and this is where the problem begins. When I reach the end of the first lot and I click the button to open the next form, it jumps to the next record. So, on Form 1 we were on record 5 and then form 2 continues as record 6 (form 3 would be record 7).

All I want is for them all to appear in the same record.

Any hints as to what im' obviously doing wrong?

Many thanks!

View 12 Replies View Related

Opening Forms Blank Ready For Add Record

Feb 4, 2008

mmm the problem i get is that if i set data entry to yes it hides all my records :s any reason why this would happen? im using access 2000 btw.

View 5 Replies View Related

Forms :: Opening Subform After Entering New Record

Feb 17, 2014

What is the best way to open a linked subform using a button while in a newly created record?

I thought a simple

Code:

docmd.save

command would do (either in the "current record" or the "after update" event)

View 4 Replies View Related

Forms :: Opening Form To A Specific Record

May 8, 2015

I've done this dozen's of time - but it doesn't seem to be working now. I have a continuous form (frmHome) where i want a user to be able to click on a record, and be able to open up that specific record in "frmCustomer". The key field here is pkCustomerID (i have it in the query).

frmHome is run off a query ("qryCustomer").

frmCustomer has "tblCustomer" as the source.

The code i've used on a button on "frmHome" is:

DoCmd.OpenForm "frmCustomer", , , "[pkCustomerID]=" & Me!pkCustomerID

It always only open Record #1.

View 7 Replies View Related

Forms :: Opening Report To Specific Record?

Feb 11, 2014

I can open a report right with a wherecondition that opens a report based on an agent name..

DoCmd.OpenReport "SelectPSReport", acViewPreview, , "[PS_Agent]='" & Me.CboAgt & "'"

But it returns every record for that agent and I want to be able to specify the date that goes with the name.

For example Tom has a record for Feb 10, Jan 10, and Dec 13. I only want to see the record for Dec 13.

I am able to see this in my form by having a combo box for the agent and the date (the date box being based on the agent box). So now how can I add a condition to include the date combo box?

DoCmd.OpenReport "SelectPSReport", acViewPreview, , "[PS_Agent]='" & Me.CboAgt & "' And [PS_dDate]='" & Me.Cbodt & "'"

Adding the condition gives me and type mismatch error, which I think may come down to the date combo box on the form having 3 columns (only 1 is visible).

View 12 Replies View Related

Forms :: Opening Form To New Record In Subform

May 20, 2013

I have a form with a subform. Every time I open the form I want it to open to a new record in the subform (but not necessarily a new record in the main form; that will depend on some other stuff that I've already taken care of).I found a way to do that using the following VBA in the main form:

Private Sub Form_Current()
Me.EventSubform.SetFocus
DoCmd.GoToRecord , , acNewRec
End Sub

It works great, but it causes Access to automatically scroll down to the start of the subform, blocking the view of information in the main form that the user needs to see. I've tried adding a line to Form_Current() to reset the focus to the main form but it doesn't seem to work.

View 5 Replies View Related

Forms :: Forms With SubForms Opening With New Record?

Mar 8, 2013

I have a main form with multiple subforms in tab view, right now the forms only open in edit mode, I would like all forms to open to new record mode. I know I can set the main form with the switchboard manager but what about the subforms?

View 2 Replies View Related

Forms :: Opening Form To A Specific Record From Subform

Jan 28, 2014

I have a form that displays details for a specific asset and a continuous subform that lists all the purchases for that asset. I have the following code in the On Click event for one of the fields in the subform:

Dim myOrder As Integer
myOrder = Me.txtOrder
DoCmd.OpenForm "frmOrders", acNormal, , "OrderID=" & Order, acFormEdit, , "Edit"

The problem is, when I click on any item in the subform, the code returns the value of the first item in the form rather than the one clicked on. If I open the subform on its own (outside the main form) then the code works fine. I can't figure out why it won't work in a subform.

View 6 Replies View Related

Forms :: Opening Form With Inappropriate Record Source Query

Jul 28, 2013

I am setting up a generic form template that will enable me to maintain data in a standardised way. All generic code is stored in a module. There is very little code specific to the table being maintained. Much of the form functionality is determined by data held in supporting tables therefore data driven.

When a form is loaded a commonly named query is created that is used as the Record Source of the form. This query only ever returns one record and uses the value of textbox on the form as criteria in the unique id field.

Despite immediately creating the query in the Open event of the form, Access tries to process the form first and returns an error as the Record Source query applies to another form, the one last opened.

How can I create the query before anything on the form is referenced / processed without creating it before the form is opened?

View 3 Replies View Related

Forms :: Opening A Form Based On Multiple Tables On A Specific Record

Dec 31, 2014

I have a form "frm_PatientNew" based on table "tbl_patients", this form contains a button "cmd_NewVisit" which is supposed to do the following: opens the form "frm_NewVisit" for recording a new visit for the last recorded patient in "tbl_Patients", I found many approaches depending on DMax and Dlookup and they worked fine just if "frm_NewVisit" is bound to "tbl_Patients", but "frm_NewVisit" is bound to "tbl_Main" which acts as a container for all information (patient data, visit data,service done and service provider), so the form "frm_NewVisit" contains fields from different tables. I wonder if I should create "frm_NewVisit" as unbound form, then adding fields from different tables to it and using vba to populate "tbl_Main",

View 2 Replies View Related

"You Cannot Add Or Change A Record Because A Related Record Is Required In Table....

Aug 1, 2006

Hi! Please help!!!

I'm currently building a bookings database and have encountered an alert message that I cant seem to rectify -

"You cannot add or change a record because a related record is required in the table 'Booking Details'"

Basically - I have a 'Customer Database' form that is linked (via command button) to a 'Booking Details' form. Within 'Booking Details' I have 2 sub forms - 'Booking Quote' and 'Booking Payments'. Both subforms are linked to the 'Booking Details' form by the 'booking ref' field with RI.

I have no problem updating information in the 'Booking Quote' subform, but when I try to add information to 'Booking Payments' it states the above message.

Can anyone please advise as to how I can prevent this happening? I'm slowly losing my mind....!!!

Many thanks,

Stacey

View 10 Replies View Related

Tables :: Cannot Add Or Change A Record Because A Related Record Is Required In Table

Oct 22, 2012

Currently I keep getting this error: "You cannot add or change a record because a related record is required in table"..My current tables are this:

Primary Table with persons info:

Primary Key - Auto number generated
Name
Address
Email
Phone

I have 4 other tables with use check boxes.

ex:

Table 1 - Geographic locations visited

ID - Auto generated
USA
CANADA
ASIA
ECT...

Table 2 - Languages Spoken
ID - Auto generated
Spanish
Chinese
English

Table 3 - Skills
ID - Auto generated
Hunting
Dance
Singing
Weaving

Is this not a genuine one-to-one relationship table? I mean No two people would have had visited the same places and speak the same language no? I tried to create a one to one relationship with the primary key to the auto generated ID of the child tables but I'm sure that is not how you do it. Also when I try to save the check boxes in my form and I close it and come back it doesnt save and is blank again. Is it because my form gets its information from a query that takes all the information from all the tables.

how I can get this to work properly? Am i to make use of a foreign key? I've read a lot about it online and watched youtube videos but I dont see why I need it here in this case. Is there a way to set the IDs in the child tables to be the ones from the primary table? Or do I have to use a foreign key and manually input the primary ID into them?

Or would it be better to have all these child tables in the primary table and have one large table instead? I just didnt do that because one of them has like 20 checkboxes with cities and locations

View 12 Replies View Related

Cannot Add Or Change A Record Because Related Record Is Required In Table

Aug 12, 2013

I have a problem with my access form, it said "You cannot add or change a record because a related record is required in table". I have attached the access file.

View 14 Replies View Related

Forms :: Closing Opening Form With Timer Then Opening Main Menu

Apr 7, 2014

I have a Form opening from Access Options. I would like to close this Form using the Timer. The following is the code I have used but it is not working.

Private Sub Cover_Page_Form_Load()
OpenTimer = Timer
End Sub
Private Sub Cover_Page_Form_Timer()
If (Timer - OpenTime) = 5 Then DoCmd.Close acForm, "Cover_Page_Form", acSaveYes
End Sub

Next question. If I can get this to work can I then use a DoCmd to open new Form within the code above or do I need a new process.

View 5 Replies View Related

Can't Add Change Record Related Record Required

Jan 24, 2007

Can someone help me out by looking at my database I've been messing with it for 3 days and I can't figure it out.
I have 4 tables each are in a 1 to 1 relationship. From there I have a query that is for every field between the 4 tables. I then have a Tab Control form with 4 tabs and it uses the qryAll I have setup. when I enter on the form I can enter info on all 4 tabs but if I try to go to a different record I get the message "You can't add or change a record because a related record is required in tblScouts". I have tried so many different options. I had even posted yesterday trying to do the same thing but my tab controls had subforms on them. The_Doc_Man was helping me with that issue but I couldn't get that to go either.
Would anyone be willing to look at it for me and explain to me what I was doing wrong?

Rick

View 5 Replies View Related







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