473,769 Members | 5,910 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

I have an expression in the query under my form to autofill the date but it wont write to the underlying table

I have an expression in the query under my form to autofill the date
under a certain condition but it wont write to the underlying table??
The date shows in the form but not the table. Does anyone know a
solution for this?

Thanks!

Sep 19 '06
10 2850
Thank you so much!! I guess it is time to take a class in VB code!
I love Access and I am so glad I found this website where there are so
many nice people willing to help.

Many blessings to you - thanks again!
Bob Quintal wrote:
sa********@aol. com wrote in
news:11******** **************@ k70g2000cwa.goo glegroups.com:
Hi Larry,

I actually started out by making the field default to =Date()
but the problem showed up when I realized all the records I
append to the table (which I have to do daily) automatically
populated with the default date.

I only want the date to populate the field when the record is
closed. Which is why I wrote the query to populate the "Closed
Date" field when the "Status" field has "CLOSED" entered.

But it doesn't write to the table and on requerying it only
shows the current date instead of the date it was actually
closed....

Any other suggestions would be highly appreciated. Thanks
again for taking the time for simple explanations.
Ok, you are going to write a little bit ov Visual Basic code.
I promise you it won't hurt a bit.

First put the "closed date" field on the form. Make sure the
.control Source property is set to the field in the query or
table's name.

Second, in the properties for the "status" field find the "After
Update" box on the events tab. If you already have a macro
there, stop, otherwise click in the box, and pick "Event
Procedure" from the dropdown. You'll see an ellipse(three
periods) button to the right.Click it.

The Visual Basic (VB) editor.will open with the cursor between
two lines of code that the editor has written for you.
The upper line will start "private sub status". The lower line
will be "end sub"

In between those two lines, type:
If me.[status] = "CLOSED" then
me.[Closed Date] = date()
end if

Pretty painless? And now you can add writing Visual Basic
programs to your resumé.
.
Using the After Update event of the "Status" box is so the date
will only get written when you change the status.
--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com
Sep 22 '06 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
5781
by: Russell | last post by:
I'm having a fit with a query for a range of dates. The dates are being returned from a view. The table/field that they are being selected from stores them as varchar and that same field also stores other fields from our dynamic forms. The field is called 'FormItemAnswer' and stores text, integer, date, float, etc. Anything the user can type into one of our web forms. The query looks like, select distinct from...
3
5395
by: Harvey | last post by:
Hi, I try to write an asp query form that lets client search any text-string and display all pages in my web server that contain the text. I have IIS 6.0 on a server 2003. The MSDN site says there is a sample file called Ixtrasp.asp, but I could not find it in my system although I installed indexing service. I followed the steps in MSDN site to create a basic .asp query form (too long to post it here), but it always displays: No...
4
6819
by: Andy Hutchings | last post by:
Hi everybody - hope you can help out here. I have a form in a database, which is a columnar form from one of the tables in the db - there is a sub-form to the form which is a datasheet view of another table in the db. The LinkChilds property is set to show connected records from both tables. What I'd like to do is copy and paste, or use some other method of writing, the contents of one field in one table in the form, to a field in the...
3
1772
by: JC Mugs | last post by:
Help needed for project-Access 2002(office xp) PROBLEM: Figuring out how to lookup a record and DDate field in Table1 - Take that DDate-field data from record looked up and assign it to Date field in a new record on a form using Table2. BASIC Table1 Fields: DID -Primary KEY DDate --Information I need to move to new form
4
1885
by: Trey | last post by:
How do I tell an update query to only search the records that are older then the current record? I need to figure out how to write a query that will take a record, look to see if any record with an older date and time has the same address, then marks a yes/no box to YES if it does not find a duplicate. I know this can be done, I just don't know how. I know it will take a subquery of some kind. I am just lost. Any help would
7
2276
by: J-P-W | last post by:
Hi, in the past I've spent ages writing VB routines to get around this problem, is there a simple way? I have three tables for a membership system: tblMembership - MembershipNumber; Names etc tblMembershipSubsHeader - "AmountDue" ; whether the pay by standing order and so on tblMembershipSubs - PaymentYear ; DatePaid; AmountPaid
28
16421
by: Marc Gravell | last post by:
In Linq, you can apparently get a meaningful body from and expression's .ToString(); random question - does anybody know if linq also includes a parser? It just seemed it might be a handy way to write a safe but easy implementation (i.e. no codedom) for an IBindingListView.Filter (by compiling to a Predicate<T>). Anybody know if this is possible at all? Marc
6
1733
by: Dameon99 | last post by:
Ive been looking through a whole tonne of sites to try to find out how I can make my fields mandatory but havnt been able to find something so far which actually tells me whwta I want to know. Ive tried a couple of code segments but they havnt been working. can anyone tell me how I can make fields in my code mandatory? My attempt at solving this is below: <html> <head> <title>Coals Spiral Brochure Enquiry Form</title>
4
4587
by: zion4ever | last post by:
Hello good people, Please bear with me as this is my first post and I am relative new to ASP. I do have VB6 experience. I have a form which enables users within our company to do an intranet reservation of available resources (laptops, beamers, etc). The MySql database queries are already in place, as is the ASP administration panel. The frontend that users will see however, still needs some work. I'm really close, but since I'm no...
0
9423
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10214
Oralloy
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10048
jinu1996
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9865
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7410
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6674
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3963
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.