Advertisement

04.07.2008 at 12:50AM PDT, ID: 23300662
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

EXPRESSION BUILDER

Tags: MICROSOFT ACCESS 2007, MS, 2007
Hi guys.

Right i have a form with a tick box labelled [IN STOCK]
i also have a a field called [date packed]

using expression builder i would like to write an expression that when [in stock] is ticked a the date is inserted in to the [date packed] field

again i am very new to this hence i would like try and write it in expression builder.

Cheers guys
Start your free trial to view this solution
Question Stats
Zone: Microsoft
Question Asked By: davidwalters
Solution Provided By: koutny
Participating Experts: 2
Solution Grade: A
Views: 168
Translate:
Loading Advertisement...
04.07.2008 at 01:53AM PDT, ID: 21295200

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 01:55AM PDT, ID: 21295206

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 05:12AM PDT, ID: 21296020

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 05:40AM PDT, ID: 21296224

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 05:43AM PDT, ID: 21296251

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 06:18AM PDT, ID: 21296550

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
Microsoft
  • Internet Protocols
  • Applications
  • Development
  • OS
  • Hardware
  • Windows Security
Apple
  • Operating Systems
  • Hardware
  • Programming
  • Networking
  • Software
Internet
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Spy / Ad Blockers
  • Web Browsers
  • New Net Users
  • Web Development
  • Chat / IM
  • Anti Spam
  • Web Servers
  • Anti-Virus
  • Email Clients
Gamers
  • Tips
  • Online / MMORPG
  • Puzzle
  • Emulators
  • Action / Adventure
  • Role Playing
  • Consoles
  • Game Programming
  • Strategy
  • Sports
  • Misc
  • Computer Games
Digital Living
  • Hardware
  • New Net Users
  • New Users
  • Software
  • Digital Music
  • Gaming World
  • Home Security
  • Apple
  • Networking Hardware
Virus & Spyware
  • Vulnerabilities
  • IDS
  • Encryption
  • Anti-Virus
  • Operating Systems Security
  • Software Firewalls
  • WebApplications
  • Cell Phones
  • Operating Systems
  • Internet
  • Hardware Firewalls
Hardware
  • Handhelds / PDAs
  • Displays / Monitors
  • Components
  • Networking Hardware
  • Peripherals
  • Laptops/Notebooks
  • Storage
  • Servers
  • Desktops
  • New Users
  • Misc
  • Apple
Software
  • System Utilities
  • Industry Specific
  • Network Management
  • Photos / Graphics
  • Page Layout
  • VMWare
  • Misc
  • Web Development
  • OS
  • CYGWIN
  • Voice Recognition
  • Message Queue
  • Quality Assurance
  • Security
  • Firewalls
  • MultiMedia Applications
  • Development
  • Database
  • Office / Productivity
  • Business Management
  • OS/2 Apps
  • Server Software
  • Internet / Email
ITPro
  • OS
  • Storage
  • Encryption
  • Operating Systems Security
  • Apple Hardware
  • Laptops & Notebooks
  • Servers
  • Networking Hardware
  • Peripherals
  • Devices
  • Displays / Monitors
  • WebTrends / Stats
  • Search Engines
  • Firewalls
  • WebApplications
  • IDS
  • Vulnerabilities
  • Email Clients
  • File Sharing
  • Spy / Ad Blockers
  • Web Browsers
  • Web Servers
  • Networking
  • Anti-Virus
  • Chat / IM
  • Anti Spam
Developer
  • Web Servers
  • Web Browsers
  • Game Programming
  • Dev Tools
  • Industry Specific
  • Office / Productivity
  • Database
  • CYGWIN
  • Web Development
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Programming
  • Content Management
  • Application Servers
  • Protocols
Storage
  • Removable Backup Media
  • Storage Technology
  • Servers
  • Grid
  • Remote Access
  • Backup / Restore
  • Misc
  • Hard Drives
OS
  • Miscellaneous
  • Security
  • Development
  • Linux
  • VMWare
  • MainFrame OS
  • Unix
  • Apple
  • OS / 2
  • AS / 400
  • BeOS
  • Microsoft
  • VMS / OpenVMS
Database
  • Oracle
  • Miscellaneous
  • MySQL
  • Software
  • Sybase
  • Contact Management
  • PostgreSQL
  • Data Manipulation
  • Clarion
  • InterSystems Cache
  • Siebel
  • MUMPS
  • OLAP
  • SQLBase
  • SAS
  • GIS & GPS
  • 4GL
  • Berkeley DB
  • DB2
  • Informix
  • Interbase / Firebird
  • FoxPro
  • Reporting
  • LDAP
  • Filemaker Pro
  • MS SQL Server
  • dBase
  • MS Access
Security
  • Misc
  • Web Browsers
  • Software Firewalls
  • Operating Systems Security
  • File Sharing
  • Spy / Ad Blockers
  • Vulnerabilities
  • WebApplications
  • IDS
  • Anti-Virus
  • Encryption
  • Anti Spam
  • Email Clients
  • VPN
  • Chat / IM
Programming
  • Editors IDEs
  • Installation
  • Handhelds / PDAs
  • Multimedia Programming
  • System / Kernel
  • Algorithms
  • Game
  • Signal Processing
  • Project Management
  • Open Source
  • Database
  • Misc
  • Languages
  • Processor Platforms
  • Theory
Web Development
  • Scripting
  • Blogs
  • Web Servers
  • Software
  • Search Engines
  • Web Graphics
  • Images
  • Internet Marketing
  • Images and Photos
  • Components
  • Document Imaging
  • Web Languages/Standards
  • Illustration
  • WebApplications
  • Fonts
  • WebTrends / Stats
  • Authoring
  • Digital Camera Software
  • Miscellaneous
Networking
  • Protocols
  • Apple Networking
  • Network Management
  • Message Queue
  • Application Servers
  • Content Management
  • File Servers
  • Email Servers
  • Misc
  • Java Editors & IDEs
  • Wireless
  • Networking Hardware
  • Backup / Restore
  • System Utilities
  • ISPs & Hosting
  • Web Servers
  • Storage Technology
  • Removable Backup Media
  • Servers
  • Broadband
  • Grid
  • OS / 2
  • Novell Netware
  • Unix Networking
  • Windows Networking
  • Security
  • Telecommunications
  • Operating Systems
  • Linux Networking
Other
  • Community Advisor
  • Lounge
  • Community Support
  • New Net Users
  • Philosophy / Religion
  • Math / Science
  • Miscellaneous
  • URLs
  • Expert Lounge
  • Politics
  • Puzzles / Riddles
Community Support
  • Suggestions
  • New to EE
  • New Topics
  • Community Advisor
  • CleanUp
  • Announcements
  • General
  • Feedback
  • Input
  • EE Bugs
 
04.07.2008 at 01:53AM PDT, ID: 21295200

Rank: Master

When do you want to have the date inserted in the the [date packed] field? When the user ticks the [in stock] check box? Or when the record is saved?
Either way I don't think you can do this with just the expression builder without using some code. I would say you would need to put code in the after update event for the check box:
Private Sub chkInStock_AfterUpdate()
    If Me![in stock] Then
        If IsNull(Me![date packed]) Then Me![date packed] = Date 'only set the date if the field is empty (null)
    End If
End Sub

The only thing you could accomplish with expression builder is inserting the date for new records but then you wouldn't be able to test the [in stock] field.
 
04.07.2008 at 01:55AM PDT, ID: 21295206

Rank: Genius

This is not something you can do in the expression builder.

You have to use an event property of the checkbox - the AfterUpdate event property - and either assign a macro or use some vba code to place the date in the textbox.  The Afterupdate  event is triggered by the user changing the checkbox value.

If you are happier creating a macro rather than vba code then you can set a value to the current date (I assume that's what you want)  using the GoToControl and SetValue actions. In the Setvalue parameters just use Date() in the Expression parameter to add the current date.

 
04.07.2008 at 05:12AM PDT, ID: 21296020
I tried using that and its returning that the field [in stock] does not exist?
do i need to put the full location of that field? i.e [table]![field]
 
04.07.2008 at 05:40AM PDT, ID: 21296224

Rank: Master

You shouldn't use the table name.
Make sure that the name of the field is correct and that the query which your form is based on includes this field.
 
04.07.2008 at 05:43AM PDT, ID: 21296251
koutny i used the code you put up and it worked! Thanks... :D
say the tickbox is unticked.. how can i remove the date?

"When do you want to have the date inserted in the the [date packed] field? When the user ticks the [in stock] check box? Or when the record is saved?
Either way I don't think you can do this with just the expression builder without using some code. I would say you would need to put code in the after update event for the check box:
Private Sub chkInStock_AfterUpdate()
    If Me![in stock] Then
        If IsNull(Me![date packed]) Then Me![date packed] = Date 'only set the date if the field is empty (null)
    End If
End Sub

The only thing you could accomplish with expression builder is inserting the date for new records but then you wouldn't be able to test the [in stock] field.
"
 
04.07.2008 at 06:18AM PDT, ID: 21296550

Rank: Master

This will work when user changes the state of the check (ie. either tick or untick):

Private Sub chkInStock_AfterUpdate()
    If Me![in stock] Then
        If IsNull(Me![date packed]) Then Me![date packed] = Date 'only set the date if the field is empty (null)
    else
         Me![date packed] = null
    End If
End Sub
Accepted Solution
 
 
04.10.2008 at 08:32AM PDT, ID: 21325924
im trying to use this again for another field but i get an error.. null function not allowed any ideas?

when you enter a delivery note i want the date to appear in the delassigndate field
when you remove the number from the delivery note i want the date to be removed..
1:
2:
3:
4:
5:
6:
7:
8:
Private Sub delivery_note_number_AfterUpdate()
    If Me![delivery note number] Then
        If IsNull(Me![delassigndate]) Then Me![delassigndate] = Date 'only set the date if the field is empty (null)
    Else
         
         Me![delassigndate] = Null
    End If
End Sub
Open in New Window
 
 
04.10.2008 at 08:46AM PDT, ID: 21326079
you will probably need to change the condition for checking whether the delivery note number has been entered:

Private Sub delivery_note_number_AfterUpdate()
    If not isnull(Me![delivery note number]) and Me![delivery note number] <> "" Then
        If IsNull(Me![delassigndate]) Then Me![delassigndate] = Date 'only set the date if the field is empty (null)
    Else
         
         Me![delassigndate] = null
    End If
End Sub
 
 
04.11.2008 at 01:49AM PDT, ID: 21332308
koutny you are the man!
Can you explain the code for me?

i undertsand the basics.. i just didnt want to just copy and paste it...

Thanks again :D
 
 
04.11.2008 at 03:41AM PDT, ID: 21332840
An if command expects a boolean expression which can be evaluated to either true of false. With a check box you can pass its value as a boolean expression because Yes/No can be easily translated to true/false.

With a text box I don't think there is a direct translation of its value to true/false (there would be in C++ but this is Visual Basic). So you need to use the isnull function which returns a true/false value. What can also happen with a text value is that it can be an empty string which is not a null value but doesn't count as a valid string for your purposes either (hence the second part of the condition)

I didn't ask where the error you were getting occured. It might be possible that you get an error when you try to clear the delassigndate field by setting it to null - you would get an error if this field is marked as required in the table design.
 
 
04.11.2008 at 03:48AM PDT, ID: 21332880
koutny i undestand now.. with a check box you automatically a yes no response where as a text box you dont.. which makes sense.. excellent.. i only wish i had assigned this as a new question so you can some more points in return.. thanks again koutny you have been again most helpfull
 
 
04.11.2008 at 03:54AM PDT, ID: 21332931
you're welcome
 
 
 
20080236-EE-VQP-29 / EE_QW_2_20070628