Forms :: Access 2010 The Same Record Be Selected In Each List Box Within The Form With Tabs
Sep 21, 2013
I have a form with 3 tab controls. Within each tab, there is a bound list box that lists records based on a combo box selection. All list boxes are bound to the same table and records in each tab will be in the same order.
Tab1, listbox1:Field1, Field2, Field3, Field4
Tab2, listbox2, Field1,Field2, Field5, Field6
Tab3, listbox3:Field1, Field2, Field7, Field8,Field9
I would like the same record be selected in each list box within the tabs, e.g. when record #2 is selected on tab1, the same record will be selected on tab2 and tab3, or if I click on tab 2 again and change the selection to record #3, record #3 will be selected on tab1 and tab2.
View Replies
Jan 19, 2005
Hi folks,
I have created a form, which extracts records from a table and displays them in
a list box. This works, but what I want to do next is highlight a single record in
that list box, click a button and have the record open in another form. This is
the code I have at present:
Private Sub DisplayEnquiry_Click()
On Error GoTo Err_DisplayEnquiry_Click
Dim dispCriteria As String
dispCriteria = "[SupportEnquiriesTable].[EnquiryID]='" & Forms![Search All].[ListSearch].Column(0) & "'"
DoCmd.OpenForm "Support Enquiries", , , dispCriteria
Exit_DisplayEnquiry_Click:
Exit Sub
Err_DisplayEnquiry_Click:
MsgBox Err.Description
Resume Exit_DisplayEnquiry_Click
End Sub
When I try this I get an error "The OpenForm action was canceled. You used a method of the DoCmd
to carry out an action in Visual Basic, but then clicked Cancel in a dialog box."
I've double-checked that I've typed in the correct names etc. so I am at my wits end!
Can anybody help me out?
Thanks
View 1 Replies
View Related
Dec 11, 2014
I have a query with the following structure;
aDate(pkey) cost1 cost2 cost3 calc1 calc2 calc3
01/012014 ,,,,,,,,,1,,,,,, 2,,,,,,, 3,,,,,, 1,,,,,,, 2,,,,, 3
01/02/2014 ,,,,,,,,1,,,,,, 2,,,,,,,, 3,,,,,, 2,,,,,, 4,,,,,, 6
01/03/2014,,,,,,, 1 ,,,,, 2,,,,,,, 3,,,,,,, 3,,,,,, 6 ,,,,, 9
01/04/2014 ,,,,,, 1,,,,,,,, 2,,,,,,, 3 ,,,,, 4,,,,,, 8,,,,,, 12
fields calc1,2,3 are running totals of cost1,2,3
I expect/hope to first calculate the sum of a cost field and then minus the value of its corresponding calc field from a specific record.
result = sum(cost1) - calc1 selected record value
I want to select the calc1 record from a drop down list of the primary key. Which cost field is in the equation will static/defined as I intend to make a textbox for each field.i need to know the code to pick a field(and retrieve it's value) from a record selected via dropdown list.
View 4 Replies
View Related
Apr 12, 2014
I am trying to create a database to manage IT assets, most of the structure is done, I'm now trying to get the details done.
The issue I am currently trying to tackle is to get a control button on one form to create a new record in the sub form that sits in the main form via another pop-up form.
So I have :
>PeripheralsViewForm - that has 4 control buttons (Edit Quantity, Edit Description,Add an Item and Exit)
>> PeripheralsSubForm - (Datasheet) which is referenced to PeripheralsQuery
The Edit Quantity and Edit Description open a separate form which allows the user to update only the quantity or description respectively (I have done it this way rather than allowing edits in the data sheet as I feel that it is too easy to hit a key incorrectly and overwrite data in the datasheet view) Both of these functions work perfectly (to my amazement) - I am using the id field in the subform to link to the pop-up form which then has unbound text input boxes, which I then write back to the subform.
e.g from edit button on click event: DoCmd.OpenForm "perquantform", , , " ID=" & Form.PeripheralsSubForm!ID and then from the pop-up form "perquantform" on the "Exit & Save" button I have :
Forms!peripheralsViewForm.PeripheralsSubForm.Form! Quantity = Me.newquant DoCmd.Close acForm, "perquantform", acSaveYes
This allows the user to select the record in the datasheet form and then click either the change quantity or description button.Also also the other reason I did it this way was because I just couldn't get the subform to requery when I had the two edit popups linked to the table or query.
The problem now is that when I click on the "Add an Item" button, it overwrites whatever record is currently selected !
The code I have is this:
From the "Add an Item" button on click action:
DoCmd.GoToRecord , Forms!peripheralsViewForm!PeripheralsSubForm.Form! , acNewRec
DoCmd.OpenForm "addperform"
And from the form "addperform" - "Save & Exit" button on click action:
Forms!peripheralsViewForm.PeripheralsSubForm.Form! PerType = Me.pertypedrop
Forms!peripheralsViewForm.PeripheralsSubForm.Form! PerMake = Me.permakedrop
Forms!peripheralsViewForm.PeripheralsSubForm.Form! PerModel = Me.newmodel
Forms!peripheralsViewForm.PeripheralsSubForm.Form! PerDescription = Me.newdescription
Forms!peripheralsViewForm.PeripheralsSubForm.Form! Quantity = Me.newquantity
DoCmd.OpenForm "PeripheralsViewForm"
DoCmd.Close acForm, "addperform"
--------------------------------------
the line "DoCmd.GoToRecord , Forms!peripheralsViewForm!PeripheralsSubForm.Form! , acNewRec" is what I have added to try to solve the overwrite issue, but when I run this it comes up with the error :
"runtime error 2498 - An expression you entered is the wrong data type for one of the arguments"
I have put this line in the "addperform" exit action and it comes up with the same sort of error.
Using Access 2010.
View 14 Replies
View Related
May 19, 2013
I have a unique "CustomerID" that is an auto number (this is how I link tables, forms, etc.), and "CustomerNumber", "CustomerName", "CustomerSubNumber" that could be null and could have duplicate values.
The first form I have is a Contact Info form where users will enter the contact information such as customer numbers, names, addresses, phone numbers, etc. This then links to an order form. My order form has a place to carry over the "CustomerNumber", "CustomerName", "CustomerSubNumber" values from the ContactInfo table. I would like these fields to automatically populate based on the CustomerID unique number as well as only show the information for that customer ID (including listing out any previous orders).
View 2 Replies
View Related
Dec 11, 2013
I'm trying to do right click menu on listbox.
currently i'm trying to implement a right click menu which will show a simple messege box.
My problem is that the list box is on a pop up form which opened up maximized. Now when i'm right clicking on the list box i see the right click menu but when i'm clicking on one of the menu options, nothing happenning (it seems that it don't go to the function as it should). i've also putted breakpoints on the function but it never tips.
It's important to mention that if i'm setting the form popup option to no the right click menu works perfectly (when i'm clicking on one of the options i see its matching messege box).
I'm running the following vba code:
This is the mouse up event handler for my list box:
Private Sub Song_List_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
' Call the SetUpContextMenu function to ensure it is setup with most current context
' Note: This really only needs to be setup once for this example since nothing is
[Code] .....
setting up the "SetUpContextMenu" sub:
Public Sub SetUpContextMenu()
' Note: This requires a reference to Microsoft Office Object Library
Dim combo As CommandBarControl
' Since it may have been defined in the past, it should be deleted,
' or if it has not been defined in the past, the error should be ignored
[code].....
View 3 Replies
View Related