|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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...) |
|
#3
|
|||
|
|||
|
Quote:
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 |
|
#4
|
|||
|
|||
|
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 |
|
#5
|
|||
|
|||
|
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. |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > making a Button visible |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|