By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,945 Members | 1,692 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,945 IT Pros & Developers. It's quick & easy.

Record navigation and date problems

P: n/a
Hello expert,

Please help me with the following problems. I have spent ages to resolve
them but no luck.

I have two forms.
(1) "Document Reception Input Form" is the main form. The search field
Document ID is unbound combo box. The table is Documents.
(2) "Document Reception Subform" is the sub form in tabular form. The linked
field is DocID. The table is DocumentReception.

After the DocumentID is selected, the subform will be filled with all the
records with the same valeu in DocID.

The user wants the form to capture the new data only. After the operator
has
keyed the data, they should clikc on the "Next" button to enter the next
entry. A "Previous" button will be available for making corrections entered
during the session, but once the operator clicks on "Accept" button no
changes can be made using the form. The date format should be yyyy/mm/dd.

I have built the main form and the subform and change the date format of the
field on the tables themselves. And I have found the following problems:

(1) The data shown on the table view are yyyy/mm/dd format. But the data
shown on the form is still dd/mm/yyyy.

(2) How to suppress a new record until the "Next" button is pressed. I
tried
the "Allow Additons"="No". But I can't add any new record on the subform.

(3) How to know which records are entered during the session and how to
disable the edit feature so that the old records cannot be edited?

(4) I got the error: 2105 It can't go to a specific record on the following
codes:

Public Sub cmdNext_Click()

On Error GoTo Err_Routine

' DoCmd.GoToRecord , , acNewRec
Me.SetFocus
DoCmd.GoToRecord , , acNext

Exit_Routine:
Exit Sub

Err_Routine:
MsgBox "Unable to create a new record. " & vbCr & " Error: " & Err.Number
& " " & Err.Description, vbOKOnly, "Error"
Resume Exit_Routine
End Sub

Private Sub cmdPrevious_Click()
Me.SetFocus
DoCmd.GoToRecord , , acPrevious
Exit_Routine:
Exit Sub

Err_Routine:
MsgBox "Unable to go to the previous record. " & vbCr & " Error: " & Err.
Number & " " & Err.Description, vbOKOnly, "Error"
Resume Exit_Routine
End Sub

Private Sub cmdUndo_Click()
Me.SetFocus
DoCmd.RunCommand acCmdUndo
Exit_Routine:
Exit Sub

Err_Routine:
MsgBox "Unable to redo the change. " & vbCr & " Error: " & Err.Number & "
" & Err.Description, vbOKOnly, "Error"
Resume Exit_Routine
End Sub
Sep 7 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
I'm not an expert however this is my view of possible a method for one of
the problems,
Can you have a form for entering data that populates a temp table?
Have an accept button that is tied to an append query that appends the new
records into the main table.

"Wes Brooks" <we********@yahoo.comwrote in message
news:5%MLg.512637$Mn5.255477@pd7tw3no...
Hello expert,

Please help me with the following problems. I have spent ages to resolve
them but no luck.

I have two forms.
(1) "Document Reception Input Form" is the main form. The search field
Document ID is unbound combo box. The table is Documents.
(2) "Document Reception Subform" is the sub form in tabular form. The
linked
field is DocID. The table is DocumentReception.

After the DocumentID is selected, the subform will be filled with all the
records with the same valeu in DocID.

The user wants the form to capture the new data only. After the operator
has
keyed the data, they should clikc on the "Next" button to enter the next
entry. A "Previous" button will be available for making corrections
entered
during the session, but once the operator clicks on "Accept" button no
changes can be made using the form. The date format should be yyyy/mm/dd.

I have built the main form and the subform and change the date format of
the
field on the tables themselves. And I have found the following problems:

(1) The data shown on the table view are yyyy/mm/dd format. But the data
shown on the form is still dd/mm/yyyy.

(2) How to suppress a new record until the "Next" button is pressed. I
tried
the "Allow Additons"="No". But I can't add any new record on the subform.

(3) How to know which records are entered during the session and how to
disable the edit feature so that the old records cannot be edited?

(4) I got the error: 2105 It can't go to a specific record on the
following
codes:

Public Sub cmdNext_Click()

On Error GoTo Err_Routine

' DoCmd.GoToRecord , , acNewRec
Me.SetFocus
DoCmd.GoToRecord , , acNext

Exit_Routine:
Exit Sub

Err_Routine:
MsgBox "Unable to create a new record. " & vbCr & " Error: " &
Err.Number
& " " & Err.Description, vbOKOnly, "Error"
Resume Exit_Routine
End Sub

Private Sub cmdPrevious_Click()
Me.SetFocus
DoCmd.GoToRecord , , acPrevious
Exit_Routine:
Exit Sub

Err_Routine:
MsgBox "Unable to go to the previous record. " & vbCr & " Error: " &
Err.
Number & " " & Err.Description, vbOKOnly, "Error"
Resume Exit_Routine
End Sub

Private Sub cmdUndo_Click()
Me.SetFocus
DoCmd.RunCommand acCmdUndo
Exit_Routine:
Exit Sub

Err_Routine:
MsgBox "Unable to redo the change. " & vbCr & " Error: " & Err.Number &
"
" & Err.Description, vbOKOnly, "Error"
Resume Exit_Routine
End Sub


Sep 7 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.