Select Record Field Or ID From Subform

Dec 6, 2004

Okay - have hunted the web for the answers to this query on and off for months. Thought I had something but it didn't work.

Problem - basic form with subform of a 'select * from table' dataset. So far I've added one textbox. I'd like this textbox to show the recordnumber selected in the subform or the KeyID of the record selected in the subform. This is so I can populate other textboxes with details of that record for editing and then control/validate data entry.

Have tried: form timer, form load and some version of seltop (not bothered about selheight at this stage) - sort of worked but not properly - at least it gave 'an' answer but not always the correct one and you had to click in and out of the subform to generate an answer.

Private Sub MySubform_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Text4.Value = MySubform.Form.SelTop
End Sub

Private Sub Form_Load()
Me.TimerInterval = 10000
End Sub

Private Sub Form_Timer()
Text4.Value = MySubform.Form.SelTop
End Sub

I think the _MouseUp sub isn't working as its not a recognised event for a subform.

I started looking at various DisplayRowID, SelRecord functions (in a separate module) run from a command button in the form footer but that's not really the right sort of thing and the referencing to the subform is a bit iffy.

I'd be grateful if anyone could advise on, even complicated, code.
Thanks,
Lez

View Replies


ADVERTISEMENT

Forms :: Select Record On Subform To Select Default Value In Combo Box?

May 6, 2014

I have a subform containing a list of Funds and attributes such as Asset Type, Fund Manager, etc.

Currently, I have a textbox, where the the control source is set so that it will be updated with the Asset Type from the subform.

I also have an unbound combo box that contains a list of Asset Types queried from a table via row source, where user can select the Asset Type.

What I would like is when a record is selected from the subform, the Asset Type is selected on the combo box as a default value. User can select another Asset Type if required. How can I do this?

View 1 Replies View Related

Forms :: Select Record From Combobox List And Have Record Populate In Subform

Sep 16, 2013

I would like to select a record from my combobox dropdown list and have that record populate in my subform. Currently, I am only able to select the 1st record at the top of the dropdown list to appear in my subform. But I would like to select any record from the dropdown list and have it populate my subform.

View 8 Replies View Related

Forms :: Select A Record From Subform?

Aug 11, 2013

I have a search form with a subform (it's a query). When you search for an entry, the results show up in my subform.

Is it possible to select that record from my subform and have it open up in my main form for making changes to that entry? Either with a control button, macro or coding?

Screen shots: The first is my search form, the second is my data entry form.

View 1 Replies View Related

Forms :: Select Same Record In Subform After Reorder?

Nov 9, 2014

I have a subform inside a form and in this subform I have an Ordering field which orders the items in the form based on this field. In the After Update event of this box I use Me.Requery so that you can actually see the change of the order in the items. The problem is that after requering the form the selector goes to the first item of the form.

Is it possible some way to keep the selector to the same item after the requery takes place?

View 1 Replies View Related

Forms :: Select Record To Edit In Form With Subform

Jan 3, 2014

I have created a form (races) with a subform (yachts in a race) to edit data in joined tables. It seems to be working well but I am having difficulty selecting which record to edit in the main form. I can scroll through the records until i get to the correct race but this won't work well when there are a large number of races to choose from.

I can see that I can use linked forms to select a race from a multi form or datasheet and call up my desired form by a double click on the ID field. This should work but isn't really elegant with users scrolling down a long datasheet to select the race record they want to work with. Is there a better way?

Races are uniquely identified by 3 attributes: SeriesDivision, Date & RaceNumber.I have created an index in the Race table for these 3 fields which forces them to be unique.I would love to create an interactive routine which asks users to select from a list for each of these 3 attributes and then returns the form for editing with the appropriate race record selected or even cascading - users select a SeriesDivision can then choose the valid dates for the selected SeriesDivision and can then select the valid raceNumbers for the selected date

View 1 Replies View Related

Forms :: Checkbox To Select Record In Continuous Subform

May 22, 2015

I have a continuous subform linked in a data query, I added some check box to select for each record. However, everytime I check a checkbox, it also check the same checkbox on the next record.

My check box consists of Shipping options - FEDEX, COURIER and HAND DELIVERY. These are the options I need to check for each records in the subform.

Is there a way I can select different checkbox for each record?

View 7 Replies View Related

Modules & VBA :: Allow User To Select Record From Subform And Add It To Table - Insert Statement

Jun 18, 2013

I have a sub form with staff records on it within a main form. I am trying to allow the user to select a record from the sub form and add it to a table, here is my code which, to me, looks correct. However it gives me an error saying "Syntax error in INSERT INTO"

Code:
Private Sub Command3_Click()
Dim dbs As Database
Dim sqlstr As String
Set dbs = CurrentDb
Forename = Nz(Forms!frm_Capex_Submission!frm_staffSub.Form.shy_forename, "")
Surname = Nz(Forms!frm_Capex_Submission!frm_staffSub.Form.shy_surname, "")

[Code] ....

View 1 Replies View Related

General :: Find Record From Field In Subform And Then Return Its Parent Record

Feb 6, 2014

I have a database which has a main form and subform built in linked by parent/child customerid, what i would like to do is search all the subform records from the whole DB and return its parent record on the main form?

Can this be done? because if i use find it will only search the filtered form i have onload of the form?

My onload event is based on fosusername()

View 3 Replies View Related

Forms :: Display Data In Form As Select Record In Subform In Data Sheet View

Nov 11, 2013

i have a main form named(EMP) i have a subform named(SEMP)with EMPID i have an another form Named(SDetail) with EMPID i want to open form Sdetail with filter records for data select in subform (SEMP) ,EMPID field Subform SEMP in as datasheet view. i can open sdetail for selected records only

View 14 Replies View Related

Rowsource Of Lookup Field Dependent On Field Value In Same Record In Subform

Jul 6, 2014

I want to create a different rowsource-query for a lookup field (field1) in each record in a subform. The rowsource changes dependent on the value in another field (field2) in the same record. How can this be done?

- I tried to change the rowsource-query in an eventmacro when the focus is set to field1, but this ofcourse changes the rowsource for all field1's and makes the allready selected values unvisible.
- I think I have to include the value of record 'field2' in the rowsource query, but i cannot find a way to include that value in the query.

Something like:

Lookup field1 in the subform contains this rowsource
- SELECT CUSTOMER.Id, CUSTOMER.AGE, CUSTOMER.NAME
FROM CUSTOMERS
WHERE (CUSTOMER.AGE= me![field2]);
me![field2] however does not function

View 5 Replies View Related

Forms :: User Select Subform Filters Other Subform

Oct 8, 2013

i have a form with 2 subforms. when the user selects a record in subform one. the date of that record filters subform 2. in the source query of subform 2 i have this under criteria

Code:
[Forms]![frmeventbuild]![frmBUILD]![EVENT_DATE]

View 3 Replies View Related

Forms :: Subform Jumping To First Record Field

May 28, 2014

I have a form with a subform for tracking the stocks trading. I use the subform to enter new transactions. This was working fine until I have made some modifications in the design, which started giving me the trouble. Whenever I try to input any transactions by selecting a combo box in the subform, it takes me to the first record, even before completing my entries. I tried my best to solve it. But not successful. I am attaching a sample file for reference.

View 14 Replies View Related

Forms :: Timestamp Record When Field In Subform Updated

Jun 16, 2014

I have a form and a subform based off a query, I am trying to run a SQL update statement from one of the fields in my subform. I know what fields in my table i want to update but the Where part of the statement is what i am having a issue with.

DoCmd.RunSQL "UPDATE [Daily Work] SET [Daily Work].QC_Start_Date = Date(),
[Daily Work].QC_Start_Time = Time() WHERE ((([Daily Work].CUS)=[Forms]![QC_Queue_Qry Subform]![CUS])
AND (([Daily Work].LN)=[Forms]![QC_Queue_Qry Subform]![LN]) AND (([Daily Work].Note_Date)=[Forms]!
[QC_Queue_Qry subform]![Note_Date])))"

What this is trying to do is once the the field is updated i want to set the date and time of that record in my table, basically I am trying to time stamp the record when the field in my subform in updated.

View 4 Replies View Related

Forms :: Subform Field Entry Creates A New Record

Oct 8, 2014

I have a main form with several tabs. One of the tabs is a subform with just one number control, driven by a select query. The control shows a number, and you can type in a new number, which then updates the field in the table.

BUT, the control then shows a zero, it has moved to a blank record. If you enter a number again, it will attempt to write it to a new record.

So how do I display the number, and allow a new number to be entered that will update the SAME record, and not moved to a new record?

View 1 Replies View Related

Copy Field Data From Main Form To A Subform On Add New Record

Feb 25, 2006

I have a main form that has some sub forms on it linked by master child on PK. When I select a new record on the sub forms I want to take a date value from the main form and populate the value into a field in the sub form. How do I do this as I cannot see a new record event on the sub form?

help would be much appreciated.
regards

Peter

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

Select Record Based On The Time Of Another Record

Apr 5, 2007

hi guys,

some background on my data:

i have a table that holds Electronic Gift Card details (those plastic store gift voucher cards). it holds all details of every transaction for every card, so the card number, activations, redemptions, dates, times, transaction values etc. are all recorded in my table.

i have attached a small extraction in a spreadsheet.

a single gift card can have multiple transactions against it throughout its lifespan. there are sometimes error transactions, and i need to write a query that finds these error transactions (they are all flagged with a "1" in the [reversal flag] field, so that bit is easy) but then also then the next transaction that occurs on that card. this subsequent transaction will not be flagged with a "1", but is a reversal of the error and will have an "802" flag in the [transaction type] field.

each transaction is date stamped hh:mm:ss, but i don't know how to write a query that will

1) find gift card number that has a reversal code of "1"
2) find next transaction made on that gift card based on transaction time
3) check that subsequent transaction type is "802"
4) select both transactions
5) repeat for entire table

i can't seem to get the desired result just using a straightforward query, and i don't know much (or any!) VBA in access.

does that make any sense at all???

cheers
bazzason

View 7 Replies View Related

Subform And Multiple Select

Jul 5, 2005

Hello there everyone

Forgive me for being a muppet: I have been searching through the forums over the past few days but am not quite sure exactly what I need. I am a newbie at access programming so any advice (preferably in language a 3 year old would understand!) would be a massive help.

Here is a little background - I am knocking up a parts database for a vehicle my company specialises in that contains suppliers along with prices for each part.

Here is my problem: I have a Parts table, a Suppliers table and an AvailableSuppliers table (because some parts are available from more than one supplier and suppliers offer more than one part - 'AvailableSuppliers' is my junction table with foreign keys to thePartID and the SupplierID).
I would like, in my 'Parts Entry' form, to have a subform where the user can choose the different Suppliers a certain part is available from (I'd hope to store the different prices as well), and to store it in the AvailableSuppliers junction table. (Is this right so far?). I'd envisage some kind of select box where I can tick from my list of Suppliers who offers the part for sale.

Am I barking up the right tree? Am I on the right track so far?

View 1 Replies View Related

Select Query As A Subform

Feb 4, 2006

Hello,

I wonder if anyone can help me I am using a select query as a subform, but it wont let me make any additions or changes. I have checked the properties of the subform and allow edits and allow additions are set to true.

Any ideas? Thanks in advance.

Regards
Nathan

View 4 Replies View Related

Forms :: Populate Subform Field When Open With A Subform Field

Sep 4, 2014

I have a form called frm002_PAF_MonitoringMAIN and on this form I have a subform called frm002_PAF_Monitoring. The subform has a button to another form for contact details called Contact_Details. The Contact_Details form opens with the details of the person who I have selected on frm002_PAF_Monitoring. There are some fields on frm002_PAF_Monitoring that I would like to be populated on Contact_Details when opened, like FirstName and LastName. How can I do it?I have tried on afterupdate event on Contact_Details below but those don't work:

Me!FirstName=[Forms]![frm002_PAF_Monitoring]![FirstName]
Me!FirstName=[Forms]![frm002_PAF_MonitoringMAIN]![frm002_PAF_Monitoring]![FirstName]
Me![FirstName].Value=[Forms]![frm002_PAF_Monitoring]![FirstName]
Me![FirstName].Value=[Forms]![frm002_PAF_MonitoringMAIN]![frm002_PAF_Monitoring]![FirstName]

View 11 Replies View Related

Select From Combobox Then Subform Update

Nov 9, 2005

plz help me how to do it...

plz look at tables
i have "monthyear" & "partno/details and month" table

i cant open all part that have same month at table monthyear...
but i can open n view customer that bought same part at partno/details...

then i cant create form from table Monthyear..i want to create form as form "test"

plz help me...
am i need a coding?
can u show me the coding?
i'm new...plz..

ahh. cant post my DB....my db size to big...700kb after zip
cant i post screenshot? :confused:

View 1 Replies View Related

Select A Datasheet Row -- Populate A 2nd SubForm Based On That Row?

Jul 12, 2005

Hi,

I'm not even sure if this is possible to do (I havn't found anything on the Net yet), but I have a Form displaying Customer information, and the vending machines that customer has.

The main form (frmAccount) has 2 SubForms:
1) AddressSubForm (is a Datasheet), listing the many addresses the one account has.
2) VendingMachineSubForm (is a Continuous Form) and displays the machines related to the account.

What I want to do is select an address in the datasheet, and have the MachineSubForm populate with what machines are located at that address. Can this be done?

The Machines and Addresses link by AddressID. Both subforms are built on queries.

Thanks for any help/insight!

Mike

View 14 Replies View Related

Having An Option Button Select A Different Subform To Come Up In The Same Location

Aug 17, 2004

Hi,
Asked this one yesterday but I think I must be doing somthing wrong. I have a main form named "Techdata" on this form I have an option group with 2 option buttons. I would like when selecting the first option button for the subform "effectivity" to show up on the main form. When the second button is selected I would like the subform "effectivity single" to show up in the same place where "effectivity" was(would like effectivity to be invisable then).
Can anyone walk me through this from whoa to go as Im havn a lil bitta trouble

Thanks for your time everyone

View 3 Replies View Related

General :: Combo Box To Select Categories In Subform

Oct 24, 2012

I use a combo box to select products and place in my order details sub form .I now realise i need a catogories table . How can i get my combo to look up a categories table then go the products of that table then enter in my orderdetails.

View 1 Replies View Related

Forms :: Selecting Record In Parent Subform From Child Continuous Subform

Jan 26, 2014

I have two subforms on a main form. Both use similar queries and nearly the same set of records and PK. The first subform is for data entry and the 2nd subform is a continuous form that lists the entries in order that are made from the 1st Subform. (for entering in vacation days and appointments)

The continuous form cannot be edited, it is to be a list for viewing the information only.

I have an edit button next to each record on the continuous form. When the button is clicked, I want it to take the 1st subform to that specific record as well (same PK), so the information can be edited there.

I cannot figure out how to get the 1st subform to go to the record on the continuous form when the button next to that record is clicked on the continuous form.

I tried the DoCmdSearch for record and just keep getting object is not open errors.

View 2 Replies View Related







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