Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old October 13th, 2005, 04:00 PM
chic0001 chic0001 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 4 chic0001 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 53 m 21 sec
Reputation Power: 0
making a Button visible

Hi All,

Could someone help me sort this please ?

After selecting a record from a drop down list of records, i have put the below code as an [Event Procedure] in the AfterUpdate event of the list box. What i want to happen is that if the control [2nd Letter Reply recieved on] has a date in then show the button for third letter. I have set the button as invisible in the properties for the command button which is named L3Button

Private Sub DonorID_AfterUpdate()
If (Forms![FRM-EditExhistingRecord]!mysubform![2nd Letter Reply recieved on]) Is Not Null Then
Me![L3Button].Visible = True
End If
End Sub

But whe I try it out i get the error message

'Run-time error '424'

Object required

on debug it highlights the line..If (Forms![FRM-EditExhistingRecord]!mysubform![2nd Letter Reply recieved on]) Is Not Null Then in yellow

Regards
Tony

Reply With Quote
  #2  
Old October 14th, 2005, 05:58 AM
WhoAmI WhoAmI is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 12 WhoAmI User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 57 m 21 sec
Reputation Power: 0
i think this will work...

try it..if not ...can u pls append the file to check..
Code:
if not vartype(Forms![FRM-EditExhistingRecord]!mysubform![2nd Letter Reply recieved on])=vbnull then


If i understand correctly then it will work out..

chk it..
all the best..


Anu..
(Please rate the post if it helps u...)

Reply With Quote
  #3  
Old October 14th, 2005, 08:20 AM
chic0001 chic0001 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 4 chic0001 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 53 m 21 sec
Reputation Power: 0
Quote:
Originally Posted by WhoAmI
i think this will work...

try it..if not ...can u pls append the file to check..
Code:
if not vartype(Forms![FRM-EditExhistingRecord]!mysubform![2nd Letter Reply recieved on])=vbnull then


If i understand correctly then it will work out..


Hi Anu,

Thanks for replying to my problem,
I tried the code you suggested, here is how i changed the code..
If Not VarType(Forms![FRM-EditExhistingRecord]!mysubform![1st Letter Reply recieved on]) = vbNull Then
Me.B3.Visible = False
Else
Me.B3.Visible = True
End If

now no error message is generated but the button always remains visible if there is a date or not a date in the 1st Letter Reply recieved on control after loading the record into my subform ?
The button named B3 is on my subform named mysubform and the control 1st Letter Reply recieved on is on my sub form this is populated from a list box when a record is selected.

Regards
Tony

Reply With Quote
  #4  
Old October 14th, 2005, 05:26 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 23 h 29 m 58 sec
Reputation Power: 181
Try

If Not (VarType(Forms![FRM-EditExhistingRecord]!mysubform![1st Letter Reply recieved on]) = vbNull) Then

Or
If Not IsNull(Forms![FRM-EditExhistingRecord]!mysubform![1st Letter Reply recieved on]) Then
__________________
======
Doug G
======
I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain

Reply With Quote
  #5  
Old October 15th, 2005, 12:12 AM
WhoAmI WhoAmI is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 12 WhoAmI User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 57 m 21 sec
Reputation Power: 0
Lightbulb reply

r u sure that both the controls (b3 and first.......) are in the same sub form (mysubform)...if so then it should work...
if both controls are in same form then

* if not vartype(me.fstletterrec)=vbnull then
me.b3.visible=true
else
me.b3.visible=false
end if **

is enough to show and hide..
by the way ..the best practice is keep the button's visible property to false in its properties page.

and i found that the control name also changed to 1st letter...
from 2nd letter...(if u chk u r 1st post and 3rd post)
can u plz snd me the database once..
if u r planning to snd...then try to snd it me aither 97 or 2000 format.


Thanx & regards
Anu.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > making a Button visible


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT