Go Back   Access World Forums > Microsoft Access Discussion > Forms

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 01-11-2019, 11:09 AM   #1
bigmac
Newly Registered User
 
Join Date: Oct 2008
Location: wales
Posts: 254
Thanks: 66
Thanked 0 Times in 0 Posts
bigmac is on a distinguished road
Question after update issue

can you help please ,
I have a subform with a field [test] this is a date field using the date picker , on the after update control I have the code , me.test.enabled = false .
(I am trying to stop it being updated twice ) , but when I run this it disables all [test] fields , how can I stop this please

bigmac is offline   Reply With Quote
Old 01-11-2019, 11:18 AM   #2
theDBguy
Iím here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 413
Thanks: 5
Thanked 72 Times in 71 Posts
theDBguy will become famous soon enough
Re: after update issue

Hi. Sounds like you are using a continuous form and [test] is an unbound control. Is this correct? If not, maybe you can post a screenshot of the form to help us picture what you're working with.
__________________
Just my 2 cents...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
theDBguy is offline   Reply With Quote
Old 01-11-2019, 11:27 AM   #3
bigmac
Newly Registered User
 
Join Date: Oct 2008
Location: wales
Posts: 254
Thanks: 66
Thanked 0 Times in 0 Posts
bigmac is on a distinguished road
Re: after update issue

here we go
Attached Images
File Type: jpg test date.JPG (65.5 KB, 11 views)

bigmac is offline   Reply With Quote
Old 01-11-2019, 11:29 AM   #4
bigmac
Newly Registered User
 
Join Date: Oct 2008
Location: wales
Posts: 254
Thanks: 66
Thanked 0 Times in 0 Posts
bigmac is on a distinguished road
Re: after update issue

the field is called test date , sorry
bigmac is offline   Reply With Quote
Old 01-11-2019, 11:31 AM   #5
theDBguy
Iím here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 413
Thanks: 5
Thanked 72 Times in 71 Posts
theDBguy will become famous soon enough
Re: after update issue

Okay. Thanks. Just as I thought, it's a continuous form. As such, you won't be able to disable only one or several rows. It's either alll or none because there's really only one control on the form. I think maybe the best approach is to use the control's BeforeUpdate event to cancel any updates if the field already has a date in it.
__________________
Just my 2 cents...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
theDBguy is offline   Reply With Quote
Old 01-11-2019, 11:34 AM   #6
bigmac
Newly Registered User
 
Join Date: Oct 2008
Location: wales
Posts: 254
Thanks: 66
Thanked 0 Times in 0 Posts
bigmac is on a distinguished road
Re: after update issue

how would I set the before update to cancel any update ?
bigmac is offline   Reply With Quote
Old 01-11-2019, 11:36 AM   #7
theDBguy
Iím here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 413
Thanks: 5
Thanked 72 Times in 71 Posts
theDBguy will become famous soon enough
Re: after update issue

You could try something like:
Code:
 Private Sub TestDate_BeforeUpdate(Cancel As Integer)
    If Me.TestDate<>Me.TestDate.OldValue Then
        Cancel = True
    End If
 End Sub

__________________
Just my 2 cents...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by theDBguy; 01-11-2019 at 12:57 PM.
theDBguy is offline   Reply With Quote
The Following User Says Thank You to theDBguy For This Useful Post:
bigmac (01-11-2019)
Old 01-11-2019, 12:47 PM   #8
Micron
Newly Registered User
 
Join Date: Oct 2018
Location: Ontario, Canada
Posts: 111
Thanks: 0
Thanked 18 Times in 16 Posts
Micron will become famous soon enough
Re: after update issue

IIRC, you can also disable via Conditional Formatting but you haven't specified under what condition(s) the combo should be disabled.


edit - and yes, I did mean on a continuous form

Micron is offline   Reply With Quote
The Following User Says Thank You to Micron For This Useful Post:
bigmac (01-11-2019)
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Update Query Issue Jameo Queries 1 05-05-2011 09:00 AM
MDE file update issue jamest85 SQL Server 1 01-23-2008 07:46 AM
update issue teiben Forms 1 10-05-2007 08:33 AM
Update Issue Ray Stantz Forms 1 04-26-2007 11:19 PM
Before update issue punter Forms 3 02-03-2007 05:03 PM




All times are GMT -8. The time now is 04:03 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World