vba to write a record
If there is a value in it, I want to save it and then create extra records for each day between the two dates (inclusive).
I have got as far as the code below, but don't really know where to go form here!
Private Sub cmdAddLeave_Click() DoCmd.RunCommand acCmdSaveRecord If Not Len(Me.Me.txtDateTo & vbNullString) = 0 Then
For LeaveDate = Me.txtDateFrom.Value + 1 To Me.txtDateTo.Value
Next Else End Sub
Thank you for taking the time to report an issue.
What's wrong... Please write below.
I've updated records before, so I think I can figure how to change the quantity in tblParts when something is taken out or returned, but I've never had to write a record to a different table before. Can someone help me with this please?
I am filtering a column of numbers for anything greater than the value of a variable. The code works when I write in the number itself, but can't write a version that uses the variable (strDate) I'm guessing the problem is the syntax but I haven't been doing VBA long enough to work out how to write it!
Selection.AutoFilter Field:=22, Criteria1:=">=20100301", Operator:=xlAnd
Table Name: tblAwardsLog
4 fields: LastName , FirstName , Recommended , DateInitiated
All fields are TEXT fields. even DateInitiated
I have this Awards Log almost to where I want it, but just can't seem to get this one thing to work right.
1. Connect to a table in my DB find the ID and return the name
2. Have the function perform a query that returns a record set from which the name is returned.
Does any one know where I can find some straight forward simple examples demonstrating this?
This is a training exercise for me to learn how to:
* Connect to tables and process data
* Create a record set and process data from the recordset
* Use debugging techniques breakpoints, run code from the immediate window etc
How to write VBA or marco to achieve the above purpose so that the operator can click a button to complete.
I would like some help with the following:
In a query that is sorted by field1 (this is the primary key)
I want to write this:
If field2.record(m)=field2.record (n) Then field3.record (p)="Yes" Else field3.record (p)="No"
field2 and field3 are texts
fields1 is a number
(m), (n), (p) are the numbers of records by which we must move from the first record in this query, if it sorted by field1
Suddenly, what has worked for years is producing a write error--only for the two of us on Access 2010. All others continue to work as they have been.
We are not accessing the same record at the same time. But in one of the subforms (that primarily creates records for a related table), when it attempts to write a new value into a field that is part of the main record, it gives the error: This record has been changed by another user since you started editing it, and forces you to save the record,write it to the clipboard, or drop the changes.
I have read other complaints about this and I've kept trying the things suggested--with either no success or the creation of new problems. The assertions that Access 2010 has not changed anything in this respect is very frustrating to those of us who know for certain that something has changed--even if it's just a setting...