Microsoft Access Forums

Go Back   Microsoft Access Forums > Access Forums > Access

Reply
 
LinkBack Thread Tools Display Modes
  #16  
Old 03-26-2009, 08:05 AM
hhuuhn hhuuhn is offline Windows XP Access 2003 (version 11.0)
Novice
 
Join Date: Mar 2009
Posts: 14
hhuuhn is on a distinguished road
Default

No, this is a text field when the table created, although it is put with numbers.
My other field code is not as complecated as this one, which is a simple condition, such as
Private Sub anticoagulation_AfterUpdate()
Me![DateOfStop].Enabled = Me![anticoagulation].Value = "0"
Me![DateOfStop].Value = ""
End
this means if a patient didn't stop taking medicine, then no date of stopped.
I really appreciate all of your time and help!
Reply With Quote
  #17  
Old 03-26-2009, 08:11 AM
hhuuhn hhuuhn is offline Windows XP Access 2003 (version 11.0)
Novice
 
Join Date: Mar 2009
Posts: 14
hhuuhn is on a distinguished road
Default

Quote:
Originally Posted by RuralGuy View Post
It looks to me like Change_smoking can *only* be 0,1 or 8. Is that true? Having fun answering two people at the same time?

Yes, it is strictly controlled, no other choices. Also, one only can select one choice, and impossible to have two people's data mixed...
Reply With Quote
  #18  
Old 03-26-2009, 08:16 AM
RuralGuy's Avatar
RuralGuy RuralGuy is online now Windows 7 Access 2007 (version 12.0)
Administrator
 
Join Date: Mar 2007
Location: 8300' in the Colorado Rocky Mountains
Posts: 4,263
RuralGuy will become famous soon enoughRuralGuy will become famous soon enough
Default

If it is a Text field then why wouldn't this code work?
Code:
Private Sub change_smoking_AfterUpdate()
   If Me![change smoking] = "8" Then
      Me![Ceased smoking] = ""
      Me![Ceased smoking].Enabled = False
      Me![ReducedSmoking] = ""
      Me![ReducedSmoking].Enabled = False
      Me![IncreasedSmoking] = ""
      Me![IncreasedSmoking].Enabled = False
   Else
      Me![Ceased smoking] = ""
      Me![Ceased smoking].Enabled = True
      Me![ReducedSmoking] = ""
      Me![ReducedSmoking].Enabled = True
      Me![IncreasedSmoking] = ""
      Me![IncreasedSmoking].Enabled = True
   End If
End Sub
__________________
(RG for short) aka Allan Bunch MS Access MVP - WinXP Pro, Win7 - acXP, ac07
If your issue is resolved...follow this link for directions on how to use the Solved thread tool!
Teaching is not filling a bucket but lighting a fire. Borrowed quote..."Docendo discimus"
Reply With Quote
  #19  
Old 03-26-2009, 08:18 AM
rommelgenlight rommelgenlight is offline Windows XP Access 2003 (version 11.0)
Advanced Beginner
 
Join Date: Mar 2009
Posts: 77
rommelgenlight is on a distinguished road
Default

on your very first message here on this forum, you said that this is a combo box. is the data on your combo box could be from a table? if so, what is the data type of your number 0,1,8 on your table?
Reply With Quote
  #20  
Old 03-26-2009, 08:30 AM
RuralGuy's Avatar
RuralGuy RuralGuy is online now Windows 7 Access 2007 (version 12.0)
Administrator
 
Join Date: Mar 2007
Location: 8300' in the Colorado Rocky Mountains
Posts: 4,263
RuralGuy will become famous soon enoughRuralGuy will become famous soon enough
Default

A lot would depend on RowSourceType, RowSource, ControlSource and BoundColumn. Would you tell us what those values are please?
__________________
(RG for short) aka Allan Bunch MS Access MVP - WinXP Pro, Win7 - acXP, ac07
If your issue is resolved...follow this link for directions on how to use the Solved thread tool!
Teaching is not filling a bucket but lighting a fire. Borrowed quote..."Docendo discimus"
Reply With Quote
  #21  
Old 03-26-2009, 10:41 AM
hhuuhn hhuuhn is offline Windows XP Access 2003 (version 11.0)
Novice
 
Join Date: Mar 2009
Posts: 14
hhuuhn is on a distinguished road
Default

Quote:
Originally Posted by rommelgenlight View Post
if it is a number format base on your lookup table, then your change_smoking.value must be a number and not text format like what you've done such as "8", "1", "0". it should only be 8,0 or 1. and like i've said you cannot make ms access decide for itself what to choose between two values there in your OR statement. you should assign one value.
Sorry, I think this is not let ms access to make choice, but to have wider choices, that means either "1" or"0" satisfys the condition it will be excuted. If only one value satisfy the condition, sure to assign one value.
Here, my data question is smoking changed or not, if Yes, or No selected, then further question, ceased or redused smoking or increased smoking. NA mean never smoked, so it doesn't make sense to have ceased, redused, increased... VB code has this function.
Also, I think here you talk data type as data format. Text type can have any kind of letters, numbers, signs, but numeric type only have number with some different format such as long, interger, simple, double etc.
My data is text type for this field, even though number is put, this number doesn't have any meaning itself, only a definition is given then it make sense, it can not be calculated. 1 means Yes, 1 can also mean No, depanding on what meaning you assign to.

Thank you very much for your time!
Reply With Quote
  #22  
Old 03-26-2009, 11:06 AM
hhuuhn hhuuhn is offline Windows XP Access 2003 (version 11.0)
Novice
 
Join Date: Mar 2009
Posts: 14
hhuuhn is on a distinguished road
Smile

Quote:
Originally Posted by RuralGuy View Post
A lot would depend on RowSourceType, RowSource, ControlSource and BoundColumn. Would you tell us what those values are please?
This field has row source type: Table/Query
Row Source: L_YN/NA ( looke up dable with two columns: Yes 1
No 0
NA 8
controlSource: change smoking ( from the main table)
Bound column: 2
Here I made typo to bound column 1. I just changed to column 2 when i checked. Now it works
Such a tiny typo made me crazy

Thanks a million to help me find problem!
Reply With Quote
  #23  
Old 03-26-2009, 12:30 PM
RuralGuy's Avatar
RuralGuy RuralGuy is online now Windows 7 Access 2007 (version 12.0)
Administrator
 
Join Date: Mar 2007
Location: 8300' in the Colorado Rocky Mountains
Posts: 4,263
RuralGuy will become famous soon enoughRuralGuy will become famous soon enough
Default

Bingo! I knew we would get there eventually. Thanks for posting back with your success.
__________________
(RG for short) aka Allan Bunch MS Access MVP - WinXP Pro, Win7 - acXP, ac07
If your issue is resolved...follow this link for directions on how to use the Solved thread tool!
Teaching is not filling a bucket but lighting a fire. Borrowed quote..."Docendo discimus"
Reply With Quote
  #24  
Old 03-26-2009, 04:50 PM
rommelgenlight rommelgenlight is offline Windows XP Access 2003 (version 11.0)
Advanced Beginner
 
Join Date: Mar 2009
Posts: 77
rommelgenlight is on a distinguished road
Default

good to know its working now.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Variable Criteria JamesLens Queries 0 01-02-2009 01:55 PM
Possible to store user-defined types in table? Binky Programming 0 11-20-2008 11:28 AM
permision problem with access97 dourvas Access 0 11-04-2008 03:07 AM
Variable question synapse5150 Programming 1 07-09-2008 06:17 AM
"Debug Error!" and crash while editting code or form Dan Herrick Access 4 04-20-2006 10:30 PM


All times are GMT -8. The time now is 02:52 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.