P
Paul E. Schoen
These will probably be simple stuff and I thought it best to just list them
as I need help.
(1) First, I finally got this to work:
Private Sub btNext_Click()
DoCmd.GoToRecord , , acNext
Rem Recordset.Move 1
Form_HorseInfo.Refresh
End Sub
The Recordset.Move seems to do the same. So is one method better than the
other?
I had problems when I tried:
DoCmd.GoToRecord (, , acNext)
which gave a compiler error expects "="
I'm just not used to function parameters not in parentheses.
(2) But now I have a minor problem. My form has buttons to advance to the
next and previous records as shown above. I also have an event handler:
Private Sub Form_Current()
tbAge = 0
If tbDOB <> "" And tbEditDate <> "" Then
tbAge = Format(Int(tbEditDate - tbDOB) / 365.25, "###.00")
End If
If Me.NewRecord Then
btNext.Enabled = False
Else
btNext.Enabled = True
End If
If Me.CurrentRecord = 1 Then
btPrevious.Enabled = False
Else
btPrevious.Enabled = True
End If
If Me.CurrentRecord = Me.Recordset.RecordCount Then
btNext.Enabled = False
Else
btNext.Enabled = True
End If
End Sub
This works fine, except that I need to click the button twice for it to
advance to the next record. It seems like the Form.Current event gets
swallowed by its handler and not passed on to the button click handler (or
vice versa). If I remove the Form.Current handler the records move as
desired, but I get errors if I click past the ends, which is why I added
the button disable. Any ideas?
(3) Finally, I would like to have this database open without the GUI menu
items. I have an autoexec to a simple main form which then launches my
other forms and reports, but I want to make it simple for the end user.
This might have something to do with loading ribbons with XML markup, but
that sounds too complicated. I just want the forms to display and perhaps
require a special way to run the program in the usual developer mode. I'm
sure this is simple but I have not found how yet. Probably as soon as I
click send to this post. But by the time I get answers I'll probably have
more questions.
Thanks,
Paul
as I need help.
(1) First, I finally got this to work:
Private Sub btNext_Click()
DoCmd.GoToRecord , , acNext
Rem Recordset.Move 1
Form_HorseInfo.Refresh
End Sub
The Recordset.Move seems to do the same. So is one method better than the
other?
I had problems when I tried:
DoCmd.GoToRecord (, , acNext)
which gave a compiler error expects "="
I'm just not used to function parameters not in parentheses.
(2) But now I have a minor problem. My form has buttons to advance to the
next and previous records as shown above. I also have an event handler:
Private Sub Form_Current()
tbAge = 0
If tbDOB <> "" And tbEditDate <> "" Then
tbAge = Format(Int(tbEditDate - tbDOB) / 365.25, "###.00")
End If
If Me.NewRecord Then
btNext.Enabled = False
Else
btNext.Enabled = True
End If
If Me.CurrentRecord = 1 Then
btPrevious.Enabled = False
Else
btPrevious.Enabled = True
End If
If Me.CurrentRecord = Me.Recordset.RecordCount Then
btNext.Enabled = False
Else
btNext.Enabled = True
End If
End Sub
This works fine, except that I need to click the button twice for it to
advance to the next record. It seems like the Form.Current event gets
swallowed by its handler and not passed on to the button click handler (or
vice versa). If I remove the Form.Current handler the records move as
desired, but I get errors if I click past the ends, which is why I added
the button disable. Any ideas?
(3) Finally, I would like to have this database open without the GUI menu
items. I have an autoexec to a simple main form which then launches my
other forms and reports, but I want to make it simple for the end user.
This might have something to do with loading ribbons with XML markup, but
that sounds too complicated. I just want the forms to display and perhaps
require a special way to run the program in the usual developer mode. I'm
sure this is simple but I have not found how yet. Probably as soon as I
click send to this post. But by the time I get answers I'll probably have
more questions.
Thanks,
Paul