A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

From form to filtered form edit not possible...



 
 
Thread Tools Display Modes
  #1  
Old December 6th, 2005, 09:27 AM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default From form to filtered form edit not possible...

Hi all,

What I am trying to do here is get from a table in datasheet view to a
filtered record in another form (read only) via a button. That works great.
Now from this form, with button again I try to go to and edit a form on which
I have locked the fields.
Unfortunately, when I press my button [unlock] on this form, it only changes
the colour (as it should) but I cannot edit the record. On top of that it
moves back to the first record...
Annyone who knows what I can do here... am novice in VBA but am learning
much thanks to this discussion forum.

Here is my coding so far.
Button from read only form to the filtered one to edit.

Private Sub Kommandoknapp94_Click()
On Error GoTo Err_Kommandoknapp94_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Läkare List"

stLinkCriteria = "[ID]=" & Me![ID]
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Kommandoknapp94_Click:
Exit Sub

Err_Kommandoknapp94_Click:
MsgBox Err.Description
Resume Exit_Kommandoknapp94_Click

End Sub

And here is the button that does the locking/Unlocking...

Private Sub Unlock_Läkare_Click()
If Me.Unlock_Läkare.Caption = "Edit Practician" Then
Me.Firstname.Locked = False
Me.Lastname.Locked = False
Me!Firstname.ForeColor = vbRed
Me!Lastname.ForeColor = vbRed
Me.Filter = ""
Me.FilterOn = True
Me.Unlock_Läkare.Caption = "Lock Changes"
Else
Me.Firstname.Locked = True
Me.Lastname.Locked = True
Me!Firstname.ForeColor = vbBlack
Me!Lastname.ForeColor = vbBlack

Me.Unlock_Läkare.Caption = "Edit Practician"
End If
End Sub


It all works great when I open the forms separately.
So the goal is : Able to edit the record that I open from the other form. on
click button.
Alternative I have in mind is create a new form without the buttons... but
then my locking security is gone...

Thanks in advance,
Greetings from Sweden

Ben

--
Novice
  #2  
Old December 7th, 2005, 04:35 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default From form to filtered form edit not possible...

solved

--
Novice


"Ben" wrote:

Hi all,

What I am trying to do here is get from a table in datasheet view to a
filtered record in another form (read only) via a button. That works great.
Now from this form, with button again I try to go to and edit a form on which
I have locked the fields.
Unfortunately, when I press my button [unlock] on this form, it only changes
the colour (as it should) but I cannot edit the record. On top of that it
moves back to the first record...
Annyone who knows what I can do here... am novice in VBA but am learning
much thanks to this discussion forum.

Here is my coding so far.
Button from read only form to the filtered one to edit.

Private Sub Kommandoknapp94_Click()
On Error GoTo Err_Kommandoknapp94_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Läkare List"

stLinkCriteria = "[ID]=" & Me![ID]
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Kommandoknapp94_Click:
Exit Sub

Err_Kommandoknapp94_Click:
MsgBox Err.Description
Resume Exit_Kommandoknapp94_Click

End Sub

And here is the button that does the locking/Unlocking...

Private Sub Unlock_Läkare_Click()
If Me.Unlock_Läkare.Caption = "Edit Practician" Then
Me.Firstname.Locked = False
Me.Lastname.Locked = False
Me!Firstname.ForeColor = vbRed
Me!Lastname.ForeColor = vbRed
Me.Filter = ""
Me.FilterOn = True
Me.Unlock_Läkare.Caption = "Lock Changes"
Else
Me.Firstname.Locked = True
Me.Lastname.Locked = True
Me!Firstname.ForeColor = vbBlack
Me!Lastname.ForeColor = vbBlack

Me.Unlock_Läkare.Caption = "Edit Practician"
End If
End Sub


It all works great when I open the forms separately.
So the goal is : Able to edit the record that I open from the other form. on
click button.
Alternative I have in mind is create a new form without the buttons... but
then my locking security is gone...

Thanks in advance,
Greetings from Sweden

Ben

--
Novice

 




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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Combo Box NotInList - How To Add Data To Underlying Table 10SNUT Using Forms 19 July 8th, 2005 09:12 PM
Toggle Button to Edit Form - Code Help [email protected] General Discussion 1 December 16th, 2004 02:08 AM
Edit PivotTable Form Manuel Using Forms 0 August 24th, 2004 11:29 AM
Strange stLinkCriteria behaviour on command button Anthony Dowd Using Forms 3 August 21st, 2004 03:01 AM
Form Doesn't Go To New Record Steve New Users 15 May 16th, 2004 04:33 PM


All times are GMT +1. The time now is 07:53 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.