Default Value Problem

cjman

Registered User.
Local time
Today, 09:57
Joined
Mar 4, 2009
Messages
28
I have the following code on an onclick event. When I change the acFormDS to acNormal it will not put the correct defaults in a new record in the Asset Pictures form. It only puts in the very first records default values. It works with acFormDS. Please advise me. I don't want to put the defaults in the form itself. I use Access 2007 with SQL Server 2005 backend.


Dim strmessage As String
Dim intOptions As Integer
Dim bytChoice As Byte
Dim StDocName As String
Dim stLinkCriteria As String

If Me.Seq > -1 Then
StDocName = "AssetPictures"
stLinkCriteria = "[RT]=" & Me![RT] & "And[workorderno]=" & Me![workorderno] & "And[Seq]=" & Me![Seq]
DoCmd.OpenForm StDocName, acFormDS, , stLinkCriteria, , acDialog
Forms![AssetPictures]!RT.DefaultValue = Me.RT
Forms![AssetPictures]!Seq.DefaultValue = Me.Seq
Forms![AssetPictures]!workorderno.DefaultValue = Me.workorderno
Else

strmessage = "Enter an asset record first."
intOptions = vbOKOnly
bytChoice = MsgBox(strmessage, intOptions)

If bytChoice = vbOK Then
Exit Sub


End If
End If
 

Users who are viewing this thread

Back
Top Bottom