i know that i can lock individual items, but when i leave the frame, can i lock that frame and all items inside there, and at the click of a button can i unlock the frame and all contents?
thanks
Printable View
i know that i can lock individual items, but when i leave the frame, can i lock that frame and all items inside there, and at the click of a button can i unlock the frame and all contents?
thanks
What do u mean by "leave the frame"?
Sure. When you lock a frame all its contents are locked and when you unlock it all the contents are unlocked.
AFAIK, Frames do not have Locked property. please correct me if i am wrong. dont have VB here.
Since frames don't have a LostFocus event then I guess to lock it when you leave it youd need to put Frame1.Locked = True in the GotFocus event of all other controls on the form except for the command button where you would say Frame1.Locked = False.
You're right. :blush: I should have said Enabled instead of Locked.Quote:
Originally Posted by Harsh Gupta
I think what Martin trying to say is, u set the frame.enabled = false and eureka! the frame is now locked!
Hope that will help!
so simply a case of if txtbox.text = "whatever" then frame1.enabled = false.... and that should lock the frame and all contents?
yes, that's right..but only the objects inside the frame will be locked..that's mean u have to put the text box and other thing inside the frame..
frame has no .locked property. They are right, use .enabled=false property instead. All controls inside the frame will be disabled.
:confused: i tried to set the frame.locked = false (frame name is fraCustomers) and even though i have done this, it stil doesnt lock :confused: now all the objects are located inside the frame, but is there a way i have to link the frame to the objects????
tryQuote:
Originally Posted by Simply Me
VB Code:
fraCustomers.enabled = true
good luck!
now im overly confused, it stil wont do anything, i have tried fraCustomers.Enabled = False
fraCustomers.Enabled = True - and neither will lock the frame and contents?????? any clues??????
sorry..it should be
VB Code:
fraCustomers.enabled = False
when u use the above code, u mean u still can write in the textbos and click the buttons inside the frame?
bcoz, when the frame in disabled (.enabled= false), all the objects inside the frame doesn't appear to be locked but u still can't use the objects inside it i.e. write in the textbox or click the buttons in the frame.
i no this seems impossible but it stil doesnt do anything :confused:
Private Sub txtOtherContact_LostFocus()
fraCustomers.Enabled = False
'fraCustomers.Enabled = True
End Sub
and
Private Sub txtOtherContact_LostFocus()
'fraCustomers.Enabled = False
fraCustomers.Enabled = True
End Sub
neither way works is there any way i need to link the objects to the frames for it to work because i really dont know why this isnt working :confused:
i tried ur codes and it worked just well..when the txtOtherContact textbox lost it focus (if u click on other objects), the frame will be locked..that's what i've got..
al send ya the project if ya like see if you can find out anythin thats wrong with it.... becuase its really driving me crazy....
There is no reason to "send" it. Just zip it using Winzip and attach it.
Are you sure you are using the correct control name?
i have only zipped up the form, not attached the tables etc. hopefully you can see what i mean...
The only thing in your Zip file is an Access database.
Are you doing this in VB6 or Access VBA?
If it is Access VBA, then that may be way the Frame disabling isn't working.
Im using microsoft access 2003, and the coding behind it is done through vb6.0, but its the default that the program opens to edit the code. and if i cant do it through the vb6 coding, how else can this be done? and i will try reposting the full project and see if anyone here can make sense of it.
so does anyone have any clues as to what might be going on becuase im at a loss for an idea. i really dont have a clue whats going on with it.... the laws of programming say that what i have used, should in theory work, but it hasnt... if anyone could help would be extremely grateful!
Thanks
All you attached was the database. Where is the VB6 code?
to access the code:
right click on an object (for example the text box next to "Event Time")
open up the properties of the box
select the "All" Tab
scroll to "On Change"
Click the On Change text box
select "[Event Procedure]"
just next to that will appear an elipse of three dots, click that and that opens the coding behind the form.
ive tried ur code and...yes, it doesn't work..i think the frame is different with the frame in vb6..so, i think that u have to lock each item..or see what anybody else have to say!
so might be a case of..... that idea is out the window, does anyone know of any ideas as to how i could possibly link the frames and objects and lock the frame that way, so i could link the frame around the customer details, to the final box in that frame? so when that box loses focus, the frame is then disabled? just becuase i created the frame after the text box, so does this explain why it cannot be disabled?
There is no VB6 code. This is an Access VBA project.Quote:
Originally Posted by MartinLiss
Moved to Office Development.