Modules & VBA :: How To Skip Continuous Recurring Values
Aug 20, 2014
See the attached png for sample records.
Many Regions, Many Towers, Many Countries and all..
Has to create a worksheet for Each Region-Tower and Paste the countries' records.
Private Sub Input_Click()
Dim Mainrset As Recordset
Dim Temp As Variant
Set Mainrset = CurrentDb.OpenRecordset("Query_Form")
Mainrset.MoveLast
Mainrset.MoveFirst
[Code] .....
The above code is not correct as some Tower/Process are not associated with some countries. Usually What I do is to loop through all the records and look for the changes in the field. Is that the only way?
When I run the following sql (in a query) I enter information once for [enter cty id]. and it all works fine.
What I would like to do now, is write the vba code so that the sql runs multiple times looping through a list of items.
For instance instead of the popup window asking "enter cty id", I'd like to automatically have the code loop through a list. For example a list of 1 through 10.
Then, in the loop vba code:
after item 1 is run, do an export of the results. after item 2, do an export. etc.
Code:
select a.south_index_id, c.cnty_cd, a.southwest_name_source_cd, sp.south_ssn, sp.estimated_birth_dt, [a.LAST_NAME] & ', ' & [a.FIRST_NAME) PERSONNAME], a.BIRTH_DT, a.GENDER_CD, sp.ms_pmi, cnty_person_id FROM SW_alias_name AS a, SW_south_person AS sp, SW_county_pid AS c WHERE EXISTS (select * from SW_alias_name a2 where ucase(a2.last_name) = ucase(a.last_name)
i've been working on a sample database today that someone has written some vb code into, which enables the database to merge with some dialler software. basically it's just a hang up and dial button on a form for surveying people.
i've done ok extracting the code for the dial and hangup buttons, referencing the external file and getting my test database to interface with the dialler but it currently allows multiple users to edit the same record, which i need to stop it doing.
the guy that's done the coding says he's more of a vb programmer and not much use in access (he's definitely better than me!) but i should be able to insert some code that will skip to the next record if the record is being worked on with someone else.
i think the piece of code that i need is
Forms("Form1").RecordLocks = 2
the only problem is i don't know what else to type with it or where in the code to insert it.
I'm having problems trying to control default values on a continuous subform. I need to be able to have the continuous subform look up values based on a CBO on the subform, populate controls on the subform with those values, and then store the values in a table that has a foreign key linked to a control on the main form. I'm not a complete newbie at this, but for some reason I can't figure this out. The closest I've gotten to this was using a Dlookup in the afterupdate of the CBO, but that only returns one value from the table regardless of what value is selected in the control. Any suggestions?
i would like to have on my continuous subform fields from my table but only as a non-editable list (I have a dedicated mod form to actually modify the values), and I don't really like the way "Locked" and/or "Enabled" work, especially on combo boxes. To me, the arrow shouldn't be there: it looks like you can modify it, but you can't; it's a bit confusing and counter intuitive.
So what I did is replace those combo boxes with text boxes, and used DLookUp in the Control Source. Now I can lock and disable the text boxes and it looks just as I want it: you can't select the text, and most importantly there's no dropdown arrow.It works, but it's kind of a lot of work compared to what it is with the cbo. Also, since those are calculated values, they take a fraction of a second to appear, as opposed to the nearly instantaneous display of the values with the cbo, and there's only 5 entries in my test database.
Thank you for your time. I want to set up an automated recurring monthly invoice for clients in my database.
I know this is possible but I am having trouble finding the solution and in fact having problems how to search for a solution.
On the 1st of every month I would like to have a query run that inserts a new row into my invoice table for all current clients invoicing them for that month.
Please please help. Invoicing one at a time using a form is taking far too long each month.
Okay I'm in the process of making a database for a Uni class and need help. The assignment requires a query to be made on a table. The query is meant to be on a table holding records of trainers teaching courses. The query is meant to obtain results of trainers teaching more than one course. I need to know how I can query recurring names or a recurring ID used. Thanks in advance. :)
I have a database that is like storage unit business. It gives you a fee once you select which unit you take for rent. When the balance is paid off, and new Month comes around i want the database to create a new balance on the table, how would i be able to do this?
I know that i can do it in two ways as i was told but i dont know how and where to start. I create some of it but i dont know what to include in the appended query etc.
i was told that In Access Help, look for COMMAND LINE OPTIONS and you will find -X macro, which is a way you can run a given macro from a command line.
"Create an append query that adds a $40 charge to every open account. Put this query to run in a macro. Create a separate icon that is private to you so that only you know where it is. Edit the icon properties to launch access on that database file with the -x macroname appended. Now use Windows Task Scheduler to launch the icon at a specific time of day on the 10th of each month. Don't forget that the macro has to end with a QUIT action."
I have a database for rental units and i have two problems that i cannot solve. I have a table with 4 different options of units with different prices. what i would like to do is for the first time customers there is 1 time fee, how would i be able to charge them only 1 time and no charge after that.
My second question would be i have a payment form also and lets say a person joined today and has to pay 40 for monthly rental and 20$(the 1 time payments) which comes to 60$, and the person pays it in full so the balance is 0$, how would i set it up that a month from now, the 0$ will turn again to 40$ so the person has to pay again?
And also would i be able to set up a late charge if they dont pay on the day that they are supposed to?
I have Datein and Dateout fields with many rows of dates beneath each. I used DatePart in a query to convert each date to a week number; but now need to count, and total, how many times each week number occurs under each field.
I'm sure this can be done easily, but I'm new to expressions, functions, etc, and would greatly appreciate some help!
I create 30 invoices a month. each client gets billed the same amount each month (for example Customer A gets billed $100 every month, Customer B gets charged $200 each month). Only two things get changed on the invoice-'Description' (for example the description would be 'services rendered for July 2014' for July invoice) and 'Invoice Date'.
Now please see the image attached, I have an append query that combines information and creates invoices for all 30 clients.
The problem is, the 'Invoice No' field in the invoice table stays empty, because I do not know how to start numbering at a specific point (for example invoice numbering should start at 14150001) and I want it to add the number (+1) automatically when this append query adds data to the invoice table.
I need to design a simple clinical database that will allow me to collect and display recurring data. Example. Every year a patient comes into clinic for follow-up. They complete a fixed data set questionnaire, their vital statistics are recorded and any new clinical results recorded. I have created all the tables/Forms but i don't know how to automatically add a new event that repeats the same data. So far i have 5 excessive years worth of follow-up data. Sadly, I have had to make massive tables by copying the identical data with either a 1,2,3,,, to signify a different year.
I am trying to track a yearly training in Access 2010 but am not quite sure how to accomplish it. The training originally was just a one-time thing, due within two weeks of a new hire's start date so I currently have it displayed as three fields in my employee table (Due Date [Calculated], Completed [Date/Time], Paid [Yes/No]). Now, employees will be required to complete this training every year (beginning January 1st, not from employee's start date) and I don't know how to accomplish the tracking it.
I need to keep each year's completion date and whether or not the employee was paid. Currently, the "Paid" field is linked to a query that populates a list of employees that have not completed the training. If the "Paid" Yes/No box is unchecked, the employee's name will be listed in the query; once I check the Yes/No box then the employee's name is removed.
What would be the easiest way to track this training for each year? There are several other training that I am tracking but are one-time only events; these too are separate fields in my Employee table.
I have the following dataset in a table called NR_PVO_120. How do i pick out a number (which can change but let's say, 6) of UNIQUE OtherIDs without excluding any OtherIDs under any fax numbers?
So, if you pick OtherID from Row7 you then also must pick OtherIDs from rows 8 and 9 because they have the same fax number. Basically, once you pick an OtherID you're then obligated to pick all OtherIDs that have the same fax number as the one you picked.
If the number requested (6 for this example) isn't possible then "the closest number possible but not exceeding" would be the rule.
For example, if you take OtherIDs from rows 1-10 you will get 6 unique OtherIDs but row 10 shares a fax with rows 11 and 12. You either need to take all 3 (but that will raise the unique count to 8, which isn't acceptable) or skip this OtherID and find one with a fax that has no other OtherIDs and that isn't on the result set already. My result of 6 UNIQUE OtherIDs will need to contain ALL OtherIDs under any fax the existing OtherIDs are connected to.
So one solution is to take rows 1-6, 26. Another is to take rows 1-4,10-14.
There will be many possibilities (the real dataset has tens of thousands of rows and the number of people requested will be around 10K), as long all OtherIDs connected to all faxes on the result set are part of the requested number (6 in this case) any combination would do.
A few notes.
1.Getting as close as possible to the requested number is a requirement.
2.Some OtherIDs will have a blank fax, they should only be included as a last resort (not enough OtherIDs for the requested number).
This is for a fax campaign, we need to make sure no fax number is faxed twice, that all people connected to that fax number are contacted under one fax sent.
i have a report that opens from a query that pulls from 8 different tables using the date as the primary key for each table. I want to be able to open my query without having to input a blank record for each date in each table. Basically I don't use every table everyday. Sometimes I just use 3-4 tables and others I will use all 8.
I am trying to use this code to filter a continuous subform based on two criteria but getting a data type mismatch error.
It works fine if I filter by just one or another. Perhaps it is not possible
Code: Dim intSpouseEntityID As Integer intSpouseEntityID = Nz(DLookup("[EntityID]", "qryEntitiesLocations", "[ContactIDNumber] =" & Me.Spouse), 0) If intSpouseEntityID > 0 And Not IsNull(Me.subformContactsHomeAddress.Form.EntityID) Then MsgBox ("There are two spouse addresses please delete one and try again") DoCmd.Save DoCmd.OpenForm "frmContactAddresses", , , "EntityID=" & Me.txtEntityID Or "EntityID =" & intSpouseEntityID End If
I have a log of items I currently inventory. When you click on an item, it opens another form with a sub-form that lists the history of changes for said item in a continuous form display.
What I want to be able to do is when that form is opened, the sub-form will highlight the last entry (either bold it, or change the background).
I have a form that is being used for sample submission. Ideally, the user will be able to put in some information (3 or 4 fields) and the number of samples that they're taking, click the arrow and it will insert that number of samples into a temporary table that is then displayed on a continuous form. From there, they can edit samples, add more samples, and generate a report to submit to the genotyping group. Once their sample list is final, I will append it to the master list and clear the temporary table.
I've got the basics working. A looped "INSERT INTO" using a counter inserts the relevant information. I cannot, however, seem to get the numbering field to work.
Ultimately, the numbers need to look something like MySample-001, where MySample would be one of the other fields. Incrementing the 001 is the problem. In another situation in the database, I can successfully use DMax+1 to assign a single number on a single form, but I can't get it to increment the sample numbers.
Ideally, I'd like it to happen when the form is generated. However, I'm also open to having them assigned when the sample list is finalized, before inserting into master table.
In my database, I have a continuous form with a Name, a Date and a Yes/No field.
When the form opens, I want to look at the date of every record on the form and show a message box if it is before the current day.
The code I have is this;
Private Sub Form_Load() With Me.RecordsetClone While Not .EOF If Me.Date1 < Date Then MsgBox "" & Me.Person & "" End If If Not .EOF Then .MoveNext Wend End With End Sub
However, it loops just the first record the amount of times there is of records (i.e., it will only show the first person's name in the message box, and will show 3 times if there are 3 records).
I am using the following by Allen Browne to sort one field. But now I need to sort on two fields.
Code: Function SortForm(frm As Form, ByVal sOrderBy As String) As Boolean On Error GoTo Err_SortForm 'Provided by Allen Browne 'Purpose: Set a form's OrderBy to the string. Reverse if already set. 'Return: True if success. 'Usage: Command button above a column in a continuous form: ' Call SortForm(Me, "MyField")
Any way to make objects to support adjusting continuous form controls making them unique in a sense to be able to change info like captions or whatever.
I've been working with collections for a while now tapping into event handlers such as the mouse inputs and or sizing of objects real time using collections but I can't seem to nail down any un-documented way to serialize controls on a continuos form.
I have tried when the new user creates the record adding another control to the collections class tying it to the id of the record but still this does not seem to be enough.
I do not know if there is a paint method or something of the sort I can override to get the desired results and most people without even trying will tell you this can't be done but how many have said that you can't move and resize objects in access but we are doing that now...