I have a date closed field on a form. How do I make this field update multiple records. For example. I have books database. I have multiple books checked out with a date. I want to update the checkout date from my checkout form on multiple records which is a continuous form. Please help
5 1330
I have attached my DB. I need to update all the records that have been selected for checkout with the checkout date from above. Somebody please help, I need this for my job. Thanks.
Firstly, I think your FPrint field should be a Y/N field, not a text box. This would change the form to having a check box.
So you would select the books that you want to apply the checkout date to by "ticking" the check box.
Secondly you need a Command Button on your form that would then run the routine to update the records with the checkout date.
Questions:
What do you want to do if there is already a checkout date against a book?
How many books are there: is the list going to be impossibly long?
Phil
There are a few different ways to go about this.
One is to use a RecordSetClone of your Form and iterate through all the records, and update the Date. Here is an example that updates an Integer field: - Dim oRst As DAO.Recordset
-
Dim iCount As Integer
-
-
iCount = 0
-
Set oRst = Me.RecordsetClone
-
oRst.MoveLast
-
oRst.MoveFirst
-
Do While Not oRst.EOF
-
iCount = iCount + 1
-
oRst.Edit
-
oRst!PrintIndex = iCount
-
oRst.update
-
oRst.MoveNext
-
Loop
Another is to build up a SQL Update Statement in VBA and then call CurrentDB.Execute: - Dim sSQL As String
-
If Len(Me.Filter) > 0 Then
-
sSQL = ""
-
sSQL = sSQL & "UPDATE Drawings SET LastModifiedDate=#" & Now() & "# "
-
sSQL = sSQL & "WHERE " & Me.Filter
-
CurrentDB.Execute sSQL
-
End If
Basically the check out date in my real dB is a destruction date. I would ultimately like to have that record archived somehow once there is a destruction date. as far as records, eventually there will be anywhere from 0-200 give or take. I really appreciate the help, I'm still kind of a novice at this, and can use all the help I can take. I really enjoy designing databases and want to learn all I can.
NeoPa 32,556
Expert Mod 16PB
I've merged these two threads as we forbid double-posting of questions here.
Unfortunately, neither attempt seems to be well enough expressed to make good sense on its own. Hopefully together they do.
@Gary.
It's your responsibility to ensure your questions are clearly laid out when you post your question originally. If, as you say, it's important for your job, then it's particularly important for you. Poor and lazy questions are far less likely to get sensible answers as the experts will struggle to match the answer to the question.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Olivia Towery |
last post by:
SQL 6.5 Database
I have a list of registrants and I want to use a check box after each record
to show those who attend and then post all with one submit button.
Any help is appreciated.
--...
|
by: Mark S. |
last post by:
Hi, I have a weird UPDATE sequence I want to perform. The customer
does not want to use INSERT and DELETE. My issue is that there are
multiple Mat_Class, but I do not wish to hard code each one...
|
by: A P |
last post by:
How can I go about updating multiple records or deleting multiple records
from a DB at a time?
|
by: Kenneth |
last post by:
Dear all,
How can I update multiple records in using ASP.NET? Currently I have a table
which require to update frequently but I can update records one by one using
DataGrid.
Kenneth
|
by: jayz24 |
last post by:
Hi everyone! I'm new in this forums and new in the line of programming..A Beginner.. I have a problem, I don't know how to populate a multiple updates. Anyone who have codes for this?
Here's...
|
by: jllopez |
last post by:
I need update multiple records in the datagrid but this is using ASP.net and VB, somebody that I can help?
|
by: Fary4u |
last post by:
how can i update multiple records corresponding to perticular ID & update values in one go ?
mode_a contains ID No.
Dim mode,mode_a,i
mode=Request("t1")
mode_a=split(mode,",")
|
by: saifulhaque |
last post by:
Hi Dear
How can insert, Display ,update multiple records simultaneously through GridView in Asp.net.
I have Button for insert, update . I want insert, update multiple records through a GridView...
|
by: Diana Miller |
last post by:
Hi All,
I have an Access 2007 report where the user selects a date from a combo box. After selecting the date, I need the AfterUpdate() event of the combo box to fill in text fields with a...
|
by: IngePTE01 |
last post by:
Hi,
I have an existing database that I would like to edit.
At the moment our system only allows me to update one record at a time, but I have jobs that could have up to 200 records per job that...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |