help with textbox

eshai

Registered User.
Local time
Today, 22:41
Joined
Jul 14, 2015
Messages
195
Hello everyone
I built a database of maintenance. Database work so that students report a fault by a few simple clicks on the buttons. The buttons have fixed values like location, sub-location, type of fault
I used this code
Code:
Private Sub pic5_Click()
Dim rstCategories As Recordset
Set rstCategories = CurrentDb.OpenRecordset(Name:="my table name", Type:=RecordsetTypeEnum.dbOpenDynaset)
With rstCategories
    With rstCategories
    End With

With rstCategories
.MoveLast 0

End With

With rstCategories
    .Edit
    ![faild name] = "fault name"
    .Update
End With
End With
DoCmd.Close ObjectType:=acForm, ObjectName:=Me.Name
DoCmd.OpenForm FormName:="next form", View:=acNormal
End Sub

Now my question. The following form contains a text box
And I need him move to the last record to put some value
as you see i'm working on dao
 
Try GoToRecord right after the OpenForm.

You might want to revisit all the With/End With blocks.
 
Try GoToRecord right after the OpenForm.

You might want to revisit all the With/End With blocks.

the record go to the last
but the textbox insert the value in first record
 
I'm afraid I don't understand. If the form is on the last record, the textbox should affect that record. Can you post the db here along with instructions on how to recreate the problem?
 
I'm afraid I don't understand. If the form is on the last record, the textbox should affect that record. Can you post the db here along with instructions on how to recreate the problem?

tnx for reply
didn't get it what to post and how
 
my db is 42mb i can't upload this size
let me explain the record in the table is moving to the last but the textbox showing the first value of the table. i did "go to record" on every event
 

Users who are viewing this thread

Back
Top Bottom