Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using the "Enable or Locked" cmd for Subform

Status
Not open for further replies.

cavery

Technical User
Oct 29, 2002
129
US
Hello, I had a problem with an earlier post that I couldnt get resolved....anyway. I'm toggling between two databases on my mainform, I have a text box that I double click and it opens a subform, where users can read comments. I want the users to able to update comments (using cmdAddNextStep)when the "Live" database is open, but when I'm in the "Archive" database I want the cmdAddNextStep button to be disabled, so the user cant update anything...just read comments.

Here is what I have so far, but I can't seem to get it working...
If strDatabase = "M:\Data\PD4CRF.mdb" Then
Me!fdlgTitleCommentHistory.Form!cmdAddNextStep.Enabled = False
Me.Requery
Else
If strDatabase = "C:\PD4 ARCHIVE.mdb" Then
Me!fdlgTitleCommentHistory.Form!cmdAddNextStep.Enabled = True
' Me.Requery
End If
End If

Any help would be appreciated....
Clark

 
Why not change the properties of the field in question in the Archive db. Change Enabled (default is Yes) to NO.

When the Archive db is opened, then no changes to the comment filed can be made.

Althought I haven't tried this, seems like it should work. The will most likely have to be some heading, nomenclature etc to indicate which db you are currently in.


HTH An investment in knowledge always pays the best dividends.

by Benjamin Franklin
 
Thanks for the response, but that wont work for what I'm trying to accomplish because I'm actually toggling between two databases and subform has to recognized this, henceforth change the cmdViewArchive from enabled and disabled based on what database is selected. I'm using code from FancyPrairie (thread 702-455987) which works great, but its this particular problem that I've been having headaches with....

Thanks,
Clark
 
My suggestion is to only change the field property, nothing else. I don't understand why changing a field property will create this situation.
If this causes a problem, I'm not sure what advice to offer.



Good Luck! An investment in knowledge always pays the best dividends.

by Benjamin Franklin
 
Unfornuately I'm dealing with just one form, for both databases (I'm linking between 2 seperate databases, but using the same form) therefore if I do change the property on one form, it will affect both databases..but Thanks for responding....
Clark
 
Clark,

That is an interesting approach, one that I hadn't thought of or ever encountered. If you do find a solution, could you possibly post back with the results????

Several days ago, I knew everythng there was to know about Access. Then somehow overnight, everything changed, now I don't know anything (ha ha )


Good Luck An investment in knowledge always pays the best dividends.

by Benjamin Franklin
 
As soon as I get this figured out I'll let you know....

Clark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top