473,396 Members | 1,893 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

AfterUpdate property not working.

5
I have a form on which i use a combobox and use Afterupdate
property on it..when i select value in combobox than relating fields changes its value...

After that i use afterupdate property to another combobox and put the code in event section of afterupdate property.The code is below.
//////////////////////////////////////////////
Expand|Select|Wrap|Line Numbers
  1. Private Sub Status_AfterUpdate()
  2.  
  3. Select Case Me.Status
  4.   Case "Closed", "Resolved"
  5.     CloseDate.Visible = True
  6.   Case Else
  7.     CloseDate.Visible = False
  8.   End Select
  9.  
  10. End Sub
////////////////////////////////////////////////
when i have added above code than nothing changes on form. both afterupdate functions are not working.even i deleted the above function but the previous property is also not working.
kindly help me what i am doing wrong....

Thanks
Azhar Naeem
Nov 8 '13 #1

✓ answered by MikeTheBike

Hi

First, in design view, open the Status Combobox property sheet and check that the After Update event is set to [Event Procedure]

If that is not the probelm I suggest you try adding a break point in the event code and step through the code checking the values to try and understand what is happening (assuming it runs tne code !).

HTH


MTB

6 9990
MikeTheBike
639 Expert 512MB
Hi

First, in design view, open the Status Combobox property sheet and check that the After Update event is set to [Event Procedure]

If that is not the probelm I suggest you try adding a break point in the event code and step through the code checking the values to try and understand what is happening (assuming it runs tne code !).

HTH


MTB
Nov 8 '13 #2
jimatqsi
1,271 Expert 1GB
I would add that it might be a good idea to set breakpoints in all events on the form; you sometimes get surprised by some event changing the sequence from what you expect.

Jim
Nov 8 '13 #3
NeoPa
32,556 Expert Mod 16PB
An alternative to that code, with the same effect, might be :
Expand|Select|Wrap|Line Numbers
  1. Private Sub Status_AfterUpdate()
  2.     With Me
  3.         .CloseDate.Visible = (.Status In ("Closed", "Resolved"))
  4.     End With
  5. End Sub
Nov 9 '13 #4
NeoPa
32,556 Expert Mod 16PB
Azhar did set Best Answer, but to a post that doesn't answer the question (Sorry about that Jim). For now I'll guess he found that the event properties of the controls were not set so found post #2 to answer the question.
Nov 9 '13 #5
azkhan
5
I have sorted out the problem.Actually i am new in ms access VB development..therefore i have done small mistakes.
The mistake is that i am not accessing it through it "Me" that is.
CloseDate.Visible = True (Wrong)
Me.CloseDate.Visible = True (Right)

I am really thankfull to all who replied..specially NeoPa because his answer is very close to my problem.

Thanks & Regards
Azhar
Nov 11 '13 #6
NeoPa
32,556 Expert Mod 16PB
No. That is not true at all. I'm sorry.

Using "Me." is good practice, but is certainly not the reason your code didn't work originally (as it certainly would work, even without using "Me.").

Again, I cannot leave that post as Best Answer. It isn't even correct. I suspect (clearly I don't have any more information than previously) that the issue that stopped the original code from working was that the Event Properties were not set. Thus I will reassign MTB's post. Unless and until I hear that something else was the reason it was fixed.

Again, sorry to have to do this, but having posts set as Best Answer that don't answer the question is not what the feature is there for.
Nov 11 '13 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Sam | last post by:
Trying to change the visible property on a command button (access97) based on a record felid on the form. The felid is a check box felid and I am trying to make the button disappear with the...
1
by: Chicken Kebab Abdullah | last post by:
I am making a database of my movie collection and I have a form which Shows a DVD Code in a combo, and a list of the divx movies on the dvd on the right in a list box. The combo boxes bound...
3
by: jdph40 | last post by:
In Access 2002, I designed a simple database for our Safety department to enter results of a survey. There are 41 true/false statements. I have a main form called frmSurvey with a subform called...
4
by: Scott | last post by:
How can I use the value in a combobox in a custom menu as the LinkMaster property to a subform on a form? Thanks! Scott
2
by: Geoff | last post by:
This program is only for use as a demonstration when working with recordsets. The idea is that the record set s processed to determine how many books out by junior, adult and senior members of a...
8
by: Robert | last post by:
I have a form (Worksheet) that works fine by itself. I have now created a seperate form (MainForm) that has a command button in the header and an unbound subform (FormFrame) in the Detail section....
6
by: Robert | last post by:
Quick question about the visible property on a form control. I have a label that displays a message if a certain criteria is met. By default the label is visible. I want access to compare a...
5
by: mattcolenutt | last post by:
Scenario: Have a product form with an "image location" field. The image property uses this field to display the image. Problem: If an image location field has been changed, the image will not...
40
by: chhines | last post by:
I have a very long IIf statement. I think maybe I've reached the limit of how many choices you can have in the control source "Build" statement of a text box on a form. Really, the IIF statement is...
0
by: kunal choudhary | last post by:
hey I am new in c# and ASP.NET, I created a form in which there are 4 dropdown list like on the basis of ProjectID dropdown list FileID comes into FileID dropdown.Second is on the basis of FundType...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.