Can You Add The Date/time To A Newly Created Table?
Mar 9, 2007
Is it possible to have the Date/Time appear as part of the name of a table? I don't want to create and rename a table I want to run a Query that will create a Table that will have the name + date or just the date.
I have tables which I add a new post to. But I want to find its key. DoCmd.GoToRecord , , acNewRec 'Lot of data fills out the different textboxes DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70 DoCmd.Requery When I first save the data and the requery the you should expect the ID field on form to have the new unique number but it doesnt. Can you get the current unique ID on some other way?
Hokay, firstly my apologies if this is the wrong subforum, but since my question revolves around the behaviour of one of my forms I guessed the thread should go here.
I have a very simple little database which I use to log RMAs (Returned Merchandise Authorizations). The database consists of three forms:
Form A - The switchboard. The main menu, works fine. Form B - The View/Edit window. Allows me to look at the records in the database and alter them if necessary, works fine. Form C - The Add window. Has the same form layout as B, but allows for adding records only. This is the one causing problems.
Now the situation is that when I enter Form C, the box for the RMA number gets autofilled out - which is correct - thus creating a new record. However, what I want to achieve is a button on the form that will allow me to quit back to the main menu without saving the record that has been created by opening the form. This is for situations where the form has been accidentally opened, or where a form has been started, but is not required to be finished.
I launch a 'CreateNewRecords' form from a 'MainForm' form. When the 'CreateNewRecords' form closes, the new record is visible on 'Main Form'.The underlying query is unsorted, so this code in the AfterUpdate event of 'CreateNewRecords' puts the cursor on the last record displayed on 'MainForm', which is the newly created record:
Forms!frmMainForm.Requery With Forms!frmMainForm.RecordsetClone .MoveLast Forms!frmMainForm.Bookmark = .Bookmark End With
However, I intend to sort the underlying query, which means that a newly created record may appear in the middle of the records displayed on 'MainForm'.
What I want to have happen is that after a new record is created by 'CreateNewRecords', the underlying query is requeried so that all current records are displayed on 'MainForm' but also that the cursor rests on the newly created record (rather than default to the first record).
I have set up a form and only want to display the date and time that will appear automatically based on when the record was created. I definitely don't know how to do this.
The format that I'm looking for is: 07/24/13 11:45:44pm
From what I can see I would need two separate fields to accomplish this. I would prefer to only use one if possible. I would like to execute the value within the new record as it is entered. That date and time from that point should never change.
I will want to use the date and time in the future for quality control.
I am looking to (on the mainform) have the user enter into a text box whatever date they would like to enter and have that value become the current date of the system. So that all operations are based off of this newly entered date.
I'm working on a database to create service tickets for a small IT Department. I've created a form that would be sent via email using the collect data option. The thing is that I want to send an auto-response email each time a new record is created to the person(IT user) submitting the data. What is the best approach for this?
How can I send an automated email notification everytime a new record is created. I have a macro set up with the send object completed, I just can't figure out how to tweak the logic so it will do it everytime a new record is created.
I am creating an access database for recording calls and follow ups for a company
relevant tables mst_customers card_call
ID from customers and customer_id from card_call have a one to many with all records of card_call
Although its more elaborate than this, lets get down to the problem
I created a form with a subform that should basically allow selection of customer and based on this, the creation of records in card_call as per customer selected. form and subform are linked by customer_id
Everything is working except a peculiar issue where if i select a customer_id it shows all relevant records + an additional record (usually 1 or 2) that just changes the customer_id for that record.
Example
customer_ID = 2 (combobox bound to column1 and showing name/column2)
output call_ID | Customer_ID 1 | 2 2 | 2 3| 2
changing customer_id to 4 will change to 1 | 4 (new) |
I have a form with Date of Death (DOD) field. I would like update DOD from a table dbo_patient into Z_Patients table.
I have set the datatype as Date/Time in the form for Date of Death.
Code: Private Sub Update_DOD() Dim rcMain As New ADODB.Recordset, rcLocalDOD As New ADODB.Recordset Dim DOD As String rcMain.Open "select distinct PatientKey from Z_Patients", CurrentProject.Connection
[Code] ....
However I am getting some error Run-time error '-2147217913 Date type mismatch in criteria expression in section below.
Code: CurrentProject.Connection.Execute "update Z_MAIN_Processed_Patients set DateOfDeath = '" & rcLocalDOD!date_of_death & "' where PatientKey = " & !PatientKey
I have an append query that appends records to a table, and I have a form based on that table.
Users will click a button that will run the append query and then open a form for users to fill in remaining empty cells. How can I filter the form to show only the newly appended records?
Hello buddies :D, do you have any idea how to make this work?
To select data that falls within this criteria of date range between cboDate and cboDate2 (fields on my form). The date in [tblJobDetails]![timeIn] come in this format "08/17/06 10:24 AM", but the cboDate/cboDate2 (takes in date only e.g 08/17/06) what i am after is to evaluate specific hard coded time in addition to the date entered, i.e. even tho, i haven't entered time on the cboDate/cboDate2, I want specific time hard coded where e.g If i select a date range of 08/17/06 and 08/18/06 on my cboDate and cboDate2 it should really be evaluating: 08/17/06 8:00 AM to 08/18/06 8:00 AM.
This is the criteria i curentlly have on my query in design view tha works perfect in selecting date only. ([tblJobDetails]![timeIn]>=[Forms]![frmPendingJobs]![cboDate] Or [tblJobDetails]![timeIn]>=[Forms]![frmPendingJobs]![cboDate] Is Null) And ([tblJobDetails]![timeIn]<=[Forms]![frmPendingJobs]![cboDate2] Or [tblJobDetails]![timeIn]<=[Forms]![frmPendingJobs]![cboDate2] Is Null) How can I incorporate 8:00am to 8:00am into my cboDate and cboDate2. What can i do to make this happen? Your kindness will be greatly appreciated http://www.naijaryders.com/forums/images/smilies/thankyou.gif
I have a database with date and time each stored in a separate field. Now I want to query the database based on a start date/time and an end date/time. I started with the code below but it only returns events within the same time range on each day when what I really need is every event from a specified date and time through a specified date and time.
SELECT myTable.ID AS myTable_ID, myDate, myTime, FirstName, LastName FROM Staff INNER JOIN myTable ON Staff.ID = myTable.StaffID WHERE myTable.myDate >= #3/2/2014# AND myTable.myDate <= #3/3/2014# AND myTable.myTime >= #8:00PM# AND myTable.myTime <= #11:00PM# ORDER BY myDate desc
In the above example what I want is every event from 3/2/2014 8:00PM until 3/3/2014 11:00PM. But what I get instead is every event between 8:00PM and 11:00PM on 3/2/2014 and every event between 8:00PM and 11:00PM on 3/3/2014.
I am importing a txt file from a vbform. However, sometimes the file creation is delayed so I need to check the DOS modified/created date prior to running the query. Can you please provide some insight as to how to determine the txt file's modified/created date from vba?
I would like to have a date control on a form filled in automatically with the current date when a new record is created (the date would remain as is unless changed manually). I've tried programming it in VB but, being a newbie, have not been able to come up with anything that works. I'm not even sure how to trigger an event to do it just the one time when the record is created.
Hi, I have never had to do any maths with access before, so I don’t know where to start!
What I need to do is calculate remaining warranty information for products.
In the table I have 3 columns. the 1st column is "Purchase date (dd/mm/yy)" 2nd column is "Total warranty period (years)" and the 3rd column is "Remaining warranty"
The 3rd column is the one that will display how long is left to run! How do I achieve this?
I was wondering how difficult it would be to do the following:
1. A user opens up a form. 2. The user uses a combo box to select his/her name. 3. There is a date combo box on the form and by default, it is set to today's date. So when the user selects his/her name, the records for today are displayed. Changing the date will show only the records for the date shown. 4. The user will have the ability to add and delete records specific to the criteria chosen in the text boxes. Adding new records will only add records for the date chosen in the combo box. E.g. if he/she adds a record for today, it will only be seen when today's date is selected.
Will a subform have to be used for something like this? Or could it be done with one form using filters?
Any thoughts and/or approaches on this would be greatly appreciated.
Any way of setting up a table containing the following date/time fields.
StartDate StartTime EndDate EndTime
Ultimately I will need to be able to subtract these date/times to get a total time between the two. Should I combine the start date and times in one cell or keep them separate.
In either scenerio, how do I subtract the two in a query for a report?
I wanted to know if it is possible to change the name of the Table which is going to be created using a Make-Table Query via code (VBA).
For example if my Make-Table query currently creates a table with the name "Table1" I want to change it to name "Table2" and then change it Back to "Table1" or "Table3" etc.... depending on the users selection.
MP No (Primary key), Sales, Date Entry, Specs, Email
The second Table is as follows:
MP No, Quantity, Description, DWG, Price
There is a "one-to-many" relationship between the two tables through the MP No field so whenever I go to the first table there is a sub-table for each MP No. Correct?can I create an extra sub table under the sub table already created?