Modules & VBA :: Automating Data Entry For Weekly / Biweekly Dates

Oct 24, 2013

I am trying to write code for a form. When the user enters the "Number of Payments" and the "1st payment date" it will fill the amount of the payment into a specific month.

For example: 1st payment date would be 10/24 the payments would be bi-weekly and the amount would be $50.00. The number of payments would be 4. I would need it to put $50.00 into a field called "October" $100.00 into a field called "November" and $50.00 into a field called "December". In excel I would do this simply by using a (date)+14 formula. I am sure that I need to do this with loops but where to even begin.

View Replies


ADVERTISEMENT

Bi-Weekly Dates

Mar 14, 2008

I'm not really sure what to do on this one, I'd like to hear some suggestions on what everyone thinks..

I have a database where users enter information Bi-Weekly into a form. I have 2 date fields set up, one is called the RecordDate, it is the date at which the user has entered the actual data into the database. Ignore this date.

I have another date, called MainDate, which is the date that all departments need to have submitted the reports (Each department fills out these bi-weekly reports [approx 100 departments]), meaning that one complete set of 100 reports is entered every 2 weeks. Even though they are all entered at various dates within those 2 weeks, usually almost at the end of the 2 weeks, all of the reports will contain this MainDate and it will be the same for all departments every 2 weeks.

I'm looking for the easiest method to accomplish letting a user select these bi-weekly dates and making sure that the dates are correct, validation?.

Some thoughts I had
1) For instance, if typing in the bi-weekly dates, I want it so that they can only type in the dates of every 2 weeks, no other dates will be allowed.

** Best option in my opinion 2) Have a small calendar that expands when clicked right next to the MainDate field so that on the calendar you can only click on dates every 2 weeks, or have every 14 days a different color on the small box for the date. [the users seem to like the ease of using calendars, one of the reaons is is a good option in my opinion]

3) Have a dropdown? That shows the current date that is allowed to be selected based on some sort of 14 day interval cycle. (i.e. after 14 days of one cycle are up, the only option in the dropdown is to click the next MainDate, which will be exactly 14 days from that just passed.

Anyway to have this date automatically filled in after 14 since the last MainDate entry? Bi-Weekly reports are due every second Thursday.


Thanks in advance to any input you can offer
Dave

View 1 Replies View Related

Restrict Data Entry For Dates

Feb 9, 2005

I have a HUGE system which presently restricts updating a "Final Action" date to today's date only. However, I want to change it so users can input dates for only the present working week. The present coding is as follows...

Private Sub dteActioned_AfterUpdate()
Dim strTime As String

strTime = "07:30"

gintChanged = gintChanged + 1

If Not IsNull(Me![dteActioned]) Then
If Me![dteActioned] > Now Then
gintReply = MsgBox("Your actioned date is later than today !!", vbOKOnly + vbCritical, "Oops")
Me![dteActioned] = Null
Me![dteActioned].SetFocus
GoTo Exit_dteActioned_AfterUpdate:
Else
If Format(Me![dteActioned], "dd/mm/yyyy") < Format(Date, "dd/mm/yyyy") Then ' final action earlier than today
If Weekday(Now) = 2 And Format(Now, "hh:mm") > strTime Then
' If Weekday(Now) = 6 And Format(Now, "hh:mm") > strTime Then
' Not acceptable to enter a previous date
' older than 7 days is not acceptable
gintReply = MsgBox("Now too late to accept this 'Final Action' date !", vbOKOnly + vbCritical, "Oops")
Me![dteActioned] = Null
Me![dteActioned].SetFocus
GoTo Exit_dteActioned_AfterUpdate:
Else
' Previous date is acceptable but only as far back as 7 days
If CVDate(Me![dteActioned]) < CVDate(Now) Then
' older than 7 days is not acceptable
gintReply = MsgBox("Now too late to accept this 'Final Action' date !", vbOKOnly + vbCritical, "Oops")
Me![dteActioned] = Null
Me![dteActioned].SetFocus
GoTo Exit_dteActioned_AfterUpdate:
End If
End If
Else
' Actioned date is acceptable since it is today's date
DoEvents
End If
End If
End If
' if today is a Monday Only accept final action dates which fall within the previous week if today

Exit_dteActioned_AfterUpdate:

End Sub

Probably very simple but I just can't get it to work. Help please! Time is short.

View 9 Replies View Related

Modules & VBA :: Datasheet Mode Form For Both Data Entry And Data Retrieval

Feb 9, 2015

I want to use the same form in datasheet mode for data entry and retrieval. When retrieving, all controls are disabled and locked. I am trying to enable and unlock them for modifying but that isn't working.

<code>
DoCmd.OpenForm "PO_Practice Data", , , , acFormEdit, acHidden

Forms![PO_Practice Data]!PO_Name.Enabled = True
Forms![PO_Practice Data]!PO_Name.Locked = False
Forms![PO_Practice Data]!Practice_Name.Enabled = True
Forms![PO_Practice Data]!Practice_Name.Locked = False

[code]...

View 3 Replies View Related

Modules & VBA :: Automating Daily Import Of CSV File

Aug 10, 2013

We receive a daily csv file from another database and we are trying to automate this process as much as possible.

At the moment, the other system will extract any new records, save a file as importddmmyyyy.csv in a specified location e.g. c:importpendingimportddmmyyyy.csv and then make a call to open access giving access the file path as follows

masaccess.exe "C:mydatabase.mdb" /nostartup / Excl/ cmd Filepath="c:importpendingimport09082013.csv"

I have configured access to automatically open a form, "ImportForm" when it opens, and I have configured this form to automatically run an event procedure on loading "importdailyfile".

My problem lies in writing this procedure. Basically I need it to run the Transfer Text command (I have already create an import specification)

DoCmd.TransferText acImportDelim, "myimportspec", "table to append the data to", filepath, true

The problem I am facing is that as the filepath changes on a daily basis given the naming conventions (which i cannot change) and my knowledge of VBA s pretty basic, I don't know how to make the procedure pick up the filepath that the other system is providing in the call to open access.

View 3 Replies View Related

Modules & VBA :: Data Entry Application

Oct 1, 2013

I am making a database, where 10 to 20 users will be entering data. I have queries

1. I am planning to create a form with which user will be directly entering in the table, will that b right?
2. If 2 or more users will open form its own side does they all will be entering in same row number?
3. What will be the best of these, by insert query or directly to form?

View 1 Replies View Related

Automating Queries To Include New Month Of Data

Aug 10, 2005

Hi

Each month I use Access to import text files and export cleansed data to Excel.

The information contains (i.e. forecast data) that has 6 months of data. Each month, the data is rolled over to include the new month and delete the oldest month of data.

Is there a query(s) or module that can automate this process?

Would greatly appreciate any tips on this one!!

Lucas

View 1 Replies View Related

Modules & VBA :: Check Data On New Record Entry?

Oct 14, 2014

We have a table, JobRegister that people enter information on using a form, FrmOrderEntry

I would like to run a check when a serial number is entered in the field SerialNo to see if the same serial number exists where CompletionDate is null.

this would stop duplicate open orders being put on the system, or new orders being entered where the previous order hasn't been completed.

View 14 Replies View Related

Modules & VBA :: Automating Mailmerge From Access Form To Word Document

Aug 5, 2013

I am having the strangest results with my automated mailmerge. Basically it does work, but not all the time. The basic idea is to allow the user to dynamically create a query that produces a result list which fills a temporary table. The use then selects a prebuilt merge template and merge is executed against the temp table. The merge template are of the .doc type, but sme have been converted to .docx; the .doc files tend to work most often, but all of the will eventually get a Table is locked message... However if I run in test mode with code breaks and manually step through the process it always works... here is the heart of the code ...

Err_Pos = 10

Code:
DoCmd.SetWarnings False
' if tmp tbl left over from last run kill it
DoCmd.RunSQL "Drop table Word_Merge_Tmp_TBL"
Err_Pos = 12

[Code].....

There are many error cases in the error catch routine. That I have managed to make Access stop hanging when word has a problem or the table is locked. But I can't get the table to be free consistantly and why does it always work when I manually step through the code.

View 4 Replies View Related

Modules & VBA :: Alert About Existing Records During Data Entry?

Jul 23, 2014

I need to alert the user of the database in case he/she enters a record that already exists in the database. If a person enters a key type and a serial number combination that already exists in the system and has status "issued", I need a pop up message to show up.

Am I missing some quotation marks somewhere in that DCount?

Private Sub SerialNumber_AfterUpdate()
If DCount("*", "tblIssuedKeys", "KeyType = '" & Me.KeyType & "' And "Status = 'Issued'" And SerialNumber = '" & Me.SerialNumber & "'") > 0 Then
MsgBox "This key has already been issued"
Cancel = True
End If
End Sub

View 2 Replies View Related

Modules & VBA :: Can't Get Data Entry Form To Add New Record After First Time

Aug 6, 2013

I've got a data entry form bound to one table. The form has four buttons:

- Clear Fields
- Cancel
- Save and exit
- Save and add another (which should save the user input to the subform/table, clear the input fields, and allow the user to add another record)

I can't quite seem to get the "Save and add another" button to work. When I put some information in the input fields and click the button, it saves it to the subform/table perfectly, but when I try to do it again, it just edits the last record (the one just created).

How can I get that button to place the information from the input fields in a new record every time?

The _Click event for the button looks like this:

Code:
If Len(Me.field1 & Me.field2 & Me.field3) > 0 Then
Me.Refresh
btnClear_Click
DoCmd.Save
End If

View 5 Replies View Related

Modules & VBA :: Database For Data Entry - Update And Navigation

Oct 28, 2013

I have made a database for data entry, currently i have a challenge of getting it update and navigate.

On the form if the staff name is xyz it should only shows the records filled by xyz in form and navigate that records only. I am attaching the data base also....

View 3 Replies View Related

Too Many Fields - One Year Of Weekly Sales Data

Sep 6, 2007

I'm new to Access, and I've been able to figure out a way around most of the problems I've run up against, but this one has me completely stumped. I would really appreciate any help!

I need to create a query that will produce a report that will follow the sales performance data of new agents for one year. I need to have two pieces of data for each week: number of policies sold and total value of policies.

The format looks like this:

Jan1 Jan2 Jan3 Jan4 Feb1
Number 12 4 6 3 6
Value 1554 320 229 221 1824

I have been pulling weekly sales data from an external database weekly and importing it into individual tables in my Access database. I had no problem for the first 3 months, but now I am getting the error message "Too Many Fields". If I understand it right, you can have up to 255 fields in a query. I don't have anywhere near that many. What could be wrong?

Any suggestions would be greatly appreciated!

View 2 Replies View Related

Modules & VBA :: Hide Undo Button Until Data Entry On Form?

Mar 8, 2015

I have an Undo button : [btnUndo] and would like it hidden until someone starts to enter data, where it will become visible...

what code would I use? and where would

Code:
me.btnUndo.visible = true

be triggered?

View 3 Replies View Related

Modules & VBA :: Data Entry - Subform Creating Orphan Records

Feb 13, 2015

How do I display a more meaningful message instead of the cryptic error about having to enter data into blah blah blah. How can I trap that error and provide them a more meaningful message about entering data. I have tried the following;

Main form name frmPatientRecords
Sub form name DentalRecords Subform
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Nz(tblPatientDetails!recordid, 0) = 0 Then
MsgBox ("sorry. Please complete the main record entry")
Parent.SetFocus
End If
End Sub

View 14 Replies View Related

Modules & VBA :: Inserting Field Value When Adding Record Using Data Entry Form?

Dec 14, 2014

I have a form for entry and some fields are computed or result of a query from another table. I have a function that looks up a value from another table like so

************************************************** ********
Public Function GetTargetType() As Variant
GetTargetType = DLookup("type", "tblFormulations", "[tblFormulations!formulation]=Forms![frmNmsConsumptionEntry]![formulation]")
End Function
************************************************** ********

Which works fine when I test in the immediate window.Then I have this form event. This however does not insert this value when I am adding records using my continuous form.

************************************************** ********
Private Sub Form_BeforeInsert(Cancel As Integer)
Me!target_group = GetTargetType()
'Forms!frmNmsConsumptionEntry!target_group = GetTargetType()
'[tblNmsConsumption.target_group] = GetTargetType()
End Sub
************************************************** ********

making sure I can insert this value once retrieved.

View 7 Replies View Related

Modules & VBA :: Filter Diary Data Using Two Dates?

Jun 7, 2013

I have a sub form dragged into a main form that shows all existing diary entries. I have already got code for various different filters but I am struggling to wrap my head around this one. Just want the user to input two dates and then the sub form to show all the diary entries between those 2 dates. Or maybe a drop down box listing various lengths of time from today's date and showing entries within that time scale. Whatever is easiest tbh. Would I have to use date diff for this?

View 7 Replies View Related

Use A Query To Do A Running Total & Comparison With Weekly Data Points

Apr 13, 2006

I am a newbie, so please forgive me for such an easy question, but I am stumped. I attached a text file that shows the data I am working with. What I need to do is take each product (labeled Prod) and do a weekly sum on the quantities and compare against a set number to see if the quantity is lower or higher. For instance, I need to take column 12, regardless of value and compare it against set number. If the quantity is less, then I need to add the value of column 12 to column 13 and compare the summed value against set number. Again, if the sum is less than set number, I then need to take the value of column 14 and add it to the summed value of the previous step (sum of 12 & 13), then compare this new sum to set number. This process keeps taking place until I reach a summed value that is greater than set number. Once that happens I need to identify the column that sent me over the set value and hold that data. For instance, if column 33's (out of 52) summed value takes me over the set number, I want to know that it was column 33, so I can run further calculations against that value. The column header's are week numbers and I need to identify order points based on lead times and when I will run out of material. Is this beyond queries? I think so, but if it is, I don't know how to exactly begin the code in VBA either. I think I would use an If then Else stucture with a counter switch set from 1 to 52, unless comparison exits function, but not certain. HELP?????:confused:

View 3 Replies View Related

Reports :: How To Build Weekly Report Even When No Data Exist For A Week

Jun 11, 2013

how to build a weekly report to count the number of computers that have entered a defined process. I have four processes and I need the report to show counts for each process even if it's zero. The report is supposed to show the history of each process and not just the current week. Is this possible to do in a single query? Or do I have to make multiple queries?

I have a table that holds the history of each workstation including the workstationName, date of the record, the phase of the workstation, and the status of the phase. Another table holds the phase codes and phase statuses for lookup purposes.

View 2 Replies View Related

Queries :: Group And Display Data On Weekly Basis Starting On Sunday

Apr 2, 2013

I'm trying to group and display data on a weekly basis starting on Sunday. I'm using the following in a totals query with "Group By" Week Number: DatePart("ww",[Date])

My problem is that the results are returning some unexpected things.. March seems to have 6 weeks and the query is returning two months containing week number 14.. (as shown below).

2013 March 9
2013 March 10
2013 March 11
2013 March 12
2013 March 13
2013 March 14
2013 April 14

View 4 Replies View Related

Auto Entry Of Repeating Dates

Aug 14, 2006

Hi,

On my form, we can enter time off for employees. This is working pretty well, but we have some employees that have flex days every other week or even once a month.

What I would like to make possible on my form, when the user is inputing the data, He makes the initial entry, and then he has an option (checkbox?) that they can select to make this same entry every (week, other week, or 1 month from the date). Have it repeat for a year out maybe, so if the user has every other friday off. It will make an entry for every other friday for the next year.

I've been searching the forum, and I've been reading on the dateadd function. But I'm not sure how to implement it on this form, not sure if there is a way to make it repeat for a year? Also not sure if it's possible (or if that's the best choice) to have checkbox for choices using it?

Any ideas suggestions?

Thanks
Chris.

View 4 Replies View Related

Modules & VBA :: Mandatory Data Entry In Field Before Moving To Another Field

Aug 22, 2014

I have a form that users will use to add new records (customers).

There is a field named VAT_Registration_no

First of all i want some code to check for duplicates in that field only,before entering the next field.If the record exists i want to show a msgbox and set focus to the vat_registration_no field. Also I want the same thing to happen if the vat_registration_no field is empty.here is what i have tried:

Private Sub VAT_registration_no_AfterUpdate()
Dim btest As Boolean
If VAT_registration_no = "" Or IsNull(Me.VAT_registration_no) Then
MsgBox "Please enter a Vat Registration No.", vbOKOnly, "error"
Me.VAT_registration_no.SetFocus
Else
btest = True
End If
End Sub

and to all other fields:

Private Sub textfield_Enter()
If Not btest Then
Me.textfield.SetFocus
End If
End Sub

If I just press enter to go straight to the second field I dont get a msg. If I write something and delete it and press enter i get the msg but when I press ok the cursor goes to the next field. I want it to go to the vat_registration_no field again. And I also want this to happen even if dont write something and then delete it.

View 3 Replies View Related

Summing Data Between Two Dates (When Dates Are Different Per Record)

Nov 15, 2011

I have a master table which shows all transactions per record (person) over a financial year.

Each record person has a seperate package period over which their spend needs to be measured. Therefore although I have all their transactions for the year, I only want to sum their transactions between their given [start date] and [end date] which are in columns.

I need to be able to create a field which sums all expenditure per record between the start and end dates

Name Start Date End Date Invoice Date Amount

Matt 15/5/11 15/9/11 1/11/11 £100
Matt 15/5/11 15/9/11 7/7/11 £200
Matt 15/5/11 15/9/11 12/12/11 £200

In this case I would only want to sum 7/7/11 as this is between the start and end dates

I want to write something like sumif([Invoice Date] is between [start date] and [end date] - not sure where or how exactly

(The start date and end date will always be the same per person)

Is this possible in access?

View 10 Replies View Related

Data Entry - Auto Fill Data For Exisitng Accounts In Records

Mar 9, 2006

First I would like to give thanks to all the knowledgeable folks here who have helped me with my DB to date. It is working and every one is very happy and I have learned a lot.

So now I would like to add some more functionality to this existing project.

My DB is for data input of customers for a drawing. It has the following fields: Id, account number, first name, last name, date/time, score1, score2.

I t is taking a great deal of time for the users to enter in hundreds of entries a day. Most of the entries are customers who are already in the DB. I would like to get the fields to auto fill the data for existing customers say after the account number is entered. So after you put in the account the name and any other pertinent data would shows up saving users from typing it in again.

The first problem I am having is that this is still a data entry form and I can’t figure out how to be able to see the account information and still add new data to the record? The new data is a daily score they get.

Second I haven’t figured out how to call up the customers information from just the account field.

I’ve googled this and haven’t found anything terribly helpful.

View 2 Replies View Related

Forms :: Create Data Entry Form To Input Data For Field

Mar 5, 2015

I an trying to create a data entry form (IndividualsEntryFm) to input data for fields such as (First Name),(Birthdate) etc., these to be saved to the (IndividualsTbl)

I also have another table (NamesTbl) which has family names etc. The two tables are linked by a (MainID) field. I want a combo box on the individualsEntryFm so that I can select the family name. Then I wish the empty fields for the IndividualsTbl to be available to enter data.When I press the save button I then want this data saved, together with the MainID from the combo box to the IndividualsTbl.

I have set the IndividualsTbl with a (PersonID) field as an auto number each individual therefore has a unique PersonID but may well share the MainID. I'm trying to link many people to the same address.

View 1 Replies View Related

Forms :: Saving Specific Data From Data Entry Form Depending On User Selection

Dec 18, 2014

I am trying to save specific data from a data entry form to a specific depending on what the user selects from a dropdown/combo box.

So if the user selects "test company from the combo box, that data (from that form) will save to the Test company data table.

View 5 Replies View Related







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