Hi Everyone,
All I want to do is insert the current date into an existing record when a form opens. I use: Me![txtOrderDate] = FormatDateTime(Date, vbShortDate) with form event On Activate. Since the record already exists, the Default property doesn't work. I have tried events On Open, Got...
Well I tried Form Open, Load, and Activate with:
Me![txtAnalReviewDate].DefaultValue = FormatDateTime
(Date, vbShortDate)
But remember these are existing records, so I wouldn't expect the DefaultValue to work. I also tried:
Me![txtAnalReviewDate] = FormatDateTime
(Date...
I seemed to have found an answer. I used my original code, but put the:
Me![cboAnalyst] = Me![cboAnalyst].Tag
on the form's Current event. Seems to be working OK.
Now, I wanted the "default" review date to be Now()when the form is opened. But when I put:
Me![txtAnalReviewDate] =...
I had tried the following before posting my original question on the AfterUpdate event of each control that I wanted to carry forward:
Me![cboAnalyst].Tag = Me![cboAnalyst]
Then on the form's BeforeInsert:
Me![cboAnalyst] = Me![cboAnalyst].Tag
I tried this on the combo, a couple of text...
SBendBuckeye,
Thanks for your time. Now I'm confused. I have several forms where the ability to carry forward values for date, name, etc. would be great. On a group of records, based on a query, I would set the values on record #1 and have them carry forward to the last record. So initially all...
Ken,
Since I'm new at VBA I just want to be sure I'm following your idea. I would use the Union query as the source for my recordset, as in:
OpenRecordset("Union", dbOpenDynaset)
Thanks again.
Tom
Hello,
Can someone suggest a way to duplicate a record in a recordset? I was going to do this in a query with a Cartesian product, but I need to be able to conditionally duplicate some records and not duplicate others, before exporting the recordset as a text file. So what I'm looking for is a...
Rolliee,
Thanks for your suggestion, but could you expand a little on your idea? I don't understand what the array is doing or how values get into it.
-Tom
Thanks for your interest. Where I want to use this is let's say I receive a shipment of parts and I want to update the records for each part with the date it arrived. So the record already exists and I enter the for the first part and advance to the next part. I just want to carry that date from...
Hi,
Can anyone suggest the code to carry forward values on existing records? DefaultValue works only on new records, my problem is opening existing records to add more information, then carrying the values of some controls to the next record while that form is open.
Thanks!
-Tom
Checkout,
I am new to VBA, can you explain a little more about "make a recordset and play a bit around with counters and mod functions"? This is the first time I have heard about a multi-select box, it will work well for this form!
Thanks for your help.
Tom
Hello,
I need to create a form (based on a query) so that the user can select certain records and then those records are exported as a CSV file. The CSV must start with a number that represents the number of records in the file, followed by 10 blank lines, then the actual records. And, a blank...
Wow,
Two good solutions in one thread! Thanks to both of you for taking the time to solve my problems. Seeing the complete code is really great for a novice. Gives me plenty to study, too.
Much appreciated!
Regards,
Tom
Sorry, need to clarify (tired mind). When I use DatePart I'm getting a space that I can't figure out a way to remove. For example "0"&(str$(DatePart("m", "9/02/04"))) produces 0 9. There is always a space preceeding the value of DatePart.
Any ideas?
Thanks,
Tom
Hi,
I'm converting a tables and need to change dates to plain text strings:
6/4/2002 to 060402
11/9/2000 to 110900
Anyone can help on the code I'd appreciate it!!
Thanks,
Tom
Thanks Gerard!
Your English is good enough for me. Since I am new to VBA, it took me a while to understand your code was similar to an Update query and how it works. Now I need to learn some SQL.
Regards,
Tom
Thanks very, very much :-)
Your procedure worked perfectly! I didn't understand the use of the Update query. The examples in the books (see I have a couple) is just multiplying a number like you are increasing a price. So I would have totally missed the way you used it.
Regards,
Tom
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.