Record navigation and date problems

W

wesbrooks

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top