In my Access 2010 database there is a form with a large number of checkboxes enabling me to select/deselect certain record details.
Each click on one of the checkboxes triggers a VBA routine setting true/false values in one of several tables linked to the main table.
A query over all records is filtered by the true/false values of the linked tables and the resulting set of records is displayed in the (continuous) form.
The header of the form contains a text field with the value "=GetRecCount()" displaying (correctly, but randomly fast) the number of records selected:
Code: Function GetRecCount() As String Dim NumRecs As Long Dim rs As Object On Error Resume Next Set rs = Forms![Super Search].RecordsetClone rs.MoveLast NumRecs = rs.RecordCount Set rs = Nothing GetRecCount = Format(NumRecs, "##,###") End Function
Now, the funny thing is that each click on one of the boxes results in 1 call of the VBA routine setting table values, but 21 calls (!) of the text field "=GetRecCount()" in the form. I have established this by incrementing a public variable at each pass.
Why a field in a form is updated 21 times when a filter is applied?
In the form1 , I have a listbox1 with 2 columns. The values get added in the listbox using vba. Now I want to Edit the listbox values in case user enters something wrong. So when the user selects a listbox item and then EDIT button then form2 gets opened. And the textbox1 of it stores column1 of listbox1 value and textbox2 stores column 2 of listbox1 value. So the user canb make changes in the textbox values and then press SAVE button . Now I want the code that will make those changes in listbox1 of form1 and unload form2 then.
I need to return a folders directory to a text box on my forms record called Files_Directory when i click the Browse command button... The folder will have more folders within it along with documents all relivant to the folder selected, hense the need for just the folder directory rather than a file.
I need to run a parameter query in which you enter a product number and the query (a) returns the list of components and (b) then automatically reruns the query for these components. In other words, I enter an input (a product number) the query gives me outputs (component numbers) and then reruns the query with each of these outputs as the input (i.e. I want to know what are the sub-components of these components). This process stops when all the components are raw materials -- this will be easily identifiable.
Does anyone know how to set-up this type of query?
I am looking for a way to enable a user to fill in a number of fields on a form press a button(CreateButton) and duplicate the records how ever many times is stated in a text box(TxtQty). I also need this to increase the serial number by the amount of times stated in the text box.
There will need to be another text box (TxtNextSerialNumber) stating the next first available serial number
For Example: TxtNextSerialNumber = AD-Oracle-00010 TxtQty = 5 Press CreateButton to create 5 records TxtNextSerialNumber = AD-Oracle-00014
5 new records created with the below fields duplicated and the above happening.
I will then need a message box informing the user of the serial numbers created:
'You have created serial numbers AD-Oracle-00010 to AD-Oracle-00014'
Table Name: ADOracle Form Name: ADOracleTestData
Fields Names: CustomerName: Duplicate PartNumber: Duplicate OrderNumber: Duplicate OrderDate: Duplicate HoseKit: Duplicate Returns: Duplicate Comments: Duplicate SerialNumber: + the amount shown in TxtQty starting on next serial number available.
I work for a company that manufactures home appliances & electronics. When those products fail within the warranty period, we are obligated to repair the units for the customers.
We have around 200 factory technicians who make those repairs. Each tech is able to make approximately 8 repairs each day. We have a dispatching system that assigns the repairs to the techs based on their availability each day. But the problem is that we have to manually enter and adjust the schedule for all 200 techs every single day, and this takes a lot of time. And of course technicians get sick, take vacation, etc, so we have to adjust the schedule so no techs will be assigned calls when they're off.
The problem: For example, currently when a technician takes off for 2 weeks, the user has to enter 14 individual records for the tech, which is somewhat time consuming. What I need is to program a button click event to determine the two dates (startDate & endDate) and append multiple records from one single entry in the form for each date in between and including the two date fields.
I know I'll probably need to create a loop that will loop through the two dates on the form and append a record for each day, so I can then cross reference the dates to the master schedule dates to make sure that no availability is opened for the techs taking time off.
Right now, I have a contact database with email addresses, and would like to know if anyone has any suggestions on how to implement a command button that when I click on it, it will do the action as clicking on a link that says
mailto:anyone@anyone.com
If I type the mailto: before the email address, and click on it, it will open the email message window, but I am looking for a way to have the user click on a button and then it opens the email message window.
I have a situation where I am using a maketable query to create a table and then I need to use append queries to then add additional records to the created table - some of these are just run once and some multiple times.
if possible, I do not want to hard code the query multiple times i.e.
At the moment I am working a little project at work and am stuck on how to calculate departments due date based on actual order due date.
example:
OrderID: xxxxxx-xx DueDate: 10/8/13
Now let say i have 5 different departments but I want/need to know what should be the due date for each of those departments based on the due date on top.
Hi, I need help with listbox problem: I made a listbox contains peoples name from A to Z. I want to sort it via A to Z button press. It's similar with customer phone list form in Northwind.mdb sample, due to my limited knowledge, I can't replicate it using listbox.
Per the instructions detailed here... http://www.fontstuff.com/access/acctut08.htm
...I created a parameter query in the form of a drop down box that, once an option is selected, should display a form with a number of fields pre-filled from a record chosen by the drop-down selection.
The drop down has a command button with the following code in the Onclick event:
Private Sub cmdCreateReport_Click() DoCmd.OpenQuery "qryUIRFollowUp", acViewNormal, acEdit DoCmd.Close acForm, "frmOpenUIRLookUp"
As it now stands when I click the button I get the form but none of the selected data is filled in. The fields are blank.
What code to I need to add to the above to make the form hold the data selected from the drop down?
Form 1: I have a combo box on my main menu(MenuMainF) called cboCompanyType with typical values 1,2,3,4,5,etc......
Form 2: I have a command button on my administration menu(MenuAdminF) called cmdDevelopment
My goal is to have the cmdDevelopment button of Form 2 be visible if cboCompanyType on Form 1 is equal to 1,2,3, or 4, but if it is any other value, then cmdDevelopment should be not visible.
I have a dashboard-style form that has a list box with tasks connected to a query with line items of those tasks.
I have another query that will only show the line item selected from the list box. This means the query will only have one line item.
I want to have a command button below the list box that, when clicked, will modify the solo item in the second query to change a yes/no field from no to yes.
How can I accomplish this? Also, how can I make a button that deletes the selected line item?
I'd like to change the colour of the text in a command button when the user click the button, but for the text to return to it's original colour when the botton pops back up.
I'm assuming you use the following commands:
Private Sub cmdClose_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) *******CODE******** End Sub
Private Sub cmdClose_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) *******CODE******** End Sub
But I'm not sure as to how I would enter the correct code.
I need to create a command button that simply, when pressed places todays Date into a text box, the text box should have no value in untill the command button is pressed.
When a command button is onfocus, how do I make it bold or a different color and when it's not onfocus to return to it's default format? I know that this is possible with text boxes but I don't know how to do it with command buttons. Please help. Thank you!
I have 2 text boxes and 1 push button for each text box for input to table. When I click on 'SaveInput1' only Input1 is save onto the Table and when 'SaveInput2' is click only Input2 is save. I want each command button to save each input separately.
I know ACCESS have a SAVE RECORD function, but I do not want to use this because it will save the entire record all at once.
if its possible to have a button that after clicking it, it doesn't show certain records. Reason being I have a "shows" for each month on our personal site and amazon, and we've been selling on those for about 2 years, and I have a "show" for each month. But, that quickly clutters up the list box. Any way to create a button the (after typing in the name) it doesnt show only those record(s)?
After inputting data into a text box on a form i want to click on a command button which will open an email program and then put the text there so i can send it.
I'm sure this is really simple... apologies, but a search hasn't thrown up any clues.
I have a table with Invoice Value, and Commission Value in it. On the associated form I enter the Invoice Value, and also the Commisison value [which 99% of the time is set at 20%.
I am trying to make a button which, when pressed, enters the calculated commission in the form field (and underlying table) - I realise this could be in the 'On Click' property on the form, but in VBA I am after something like.
Private Sub btnCommCalc_Click() tblSales.Commission = tblSales.Invoice * 0.2 End Sub
Could someone help me with the syntax? (I can then move on to using a variable, rather than hard-wiring the 20% ;-)