GoToRecord Macro???

M

May

Hi,
I have a form with a combobox that shows all records of
one field of a table, And a host of other text boxes. The
user picks a value from the dropdown combo box, then fills
in other values in all the text boxes, thus populating
each record of that table.
Problem: The form seems to be in the first record mode
even though user chooses 2nd, 3rd or nth record, unless he
uses the record number box at the bottom.
How can I make the form point to the record number of the
value that is chosen in the combobox? If it is GoToRecord
macro then, the macro should point to which event? and
what should ObjectType, ObjectName, Record and Offset
point to?
Appreciate help. Thanks in advance.
 
K

Ken Snell

Haven't tested it but this should work:

In your GoToRecord action, set the Record argument to First. Set the Offset
argument to
[Forms]![FormName]![CombobBoxName] - 1

where FormName and ComboBoxName need to be replaced by your actual names.

Let me know if this does/doesn't work.
 
M

May

Thanks, I really appreciate your help but it did not seem
to work. The error message says Offset needs a number,
although I know an expression can be put in it. Tried
putting this macro in the form action, detail, combo box
itself, none worked. I tried GoToControl along with
GoToRecord with no success.
Values in combo box are unique (is primary key). 12 boxes
need data input by user to populate the corresponding
records.
The 12 text boxes are still showing the first record. I am
still forced to use the Record Number box to navigate
through records.
Choosing a value in record # 2 for eg. is not forcing the
rest of the objects and textboxes to point to record # 2
of the table.
I will really appreciate any further help. Thanks
-----Original Message-----
Haven't tested it but this should work:

In your GoToRecord action, set the Record argument to First. Set the Offset
argument to
[Forms]![FormName]![CombobBoxName] - 1

where FormName and ComboBoxName need to be replaced by your actual names.

Let me know if this does/doesn't work.

--
Ken Snell
<MS ACCESS MVP>

May said:
Hi,
I have a form with a combobox that shows all records of
one field of a table, And a host of other text boxes. The
user picks a value from the dropdown combo box, then fills
in other values in all the text boxes, thus populating
each record of that table.
Problem: The form seems to be in the first record mode
even though user chooses 2nd, 3rd or nth record, unless he
uses the record number box at the bottom.
How can I make the form point to the record number of the
value that is chosen in the combobox? If it is GoToRecord
macro then, the macro should point to which event? and
what should ObjectType, ObjectName, Record and Offset
point to?
Appreciate help. Thanks in advance.


.
 
K

Ken Snell

Sorry. Try putting an = sign in front of the expression:

= [Forms]![FormName]![CombobBoxName] - 1

--
Ken Snell
<MS ACCESS MVP>

May said:
Thanks, I really appreciate your help but it did not seem
to work. The error message says Offset needs a number,
although I know an expression can be put in it. Tried
putting this macro in the form action, detail, combo box
itself, none worked. I tried GoToControl along with
GoToRecord with no success.
Values in combo box are unique (is primary key). 12 boxes
need data input by user to populate the corresponding
records.
The 12 text boxes are still showing the first record. I am
still forced to use the Record Number box to navigate
through records.
Choosing a value in record # 2 for eg. is not forcing the
rest of the objects and textboxes to point to record # 2
of the table.
I will really appreciate any further help. Thanks
-----Original Message-----
Haven't tested it but this should work:

In your GoToRecord action, set the Record argument to First. Set the Offset
argument to
[Forms]![FormName]![CombobBoxName] - 1

where FormName and ComboBoxName need to be replaced by your actual names.

Let me know if this does/doesn't work.

--
Ken Snell
<MS ACCESS MVP>

May said:
Hi,
I have a form with a combobox that shows all records of
one field of a table, And a host of other text boxes. The
user picks a value from the dropdown combo box, then fills
in other values in all the text boxes, thus populating
each record of that table.
Problem: The form seems to be in the first record mode
even though user chooses 2nd, 3rd or nth record, unless he
uses the record number box at the bottom.
How can I make the form point to the record number of the
value that is chosen in the combobox? If it is GoToRecord
macro then, the macro should point to which event? and
what should ObjectType, ObjectName, Record and Offset
point to?
Appreciate help. Thanks in advance.


.
 
M

May

Thank You very much. I am very grateful for your help. I
think it is working fine now. I have not worked with
Access for long. Still learning. Thanks.

-----Original Message-----
Sorry again. Finally got chance to test, and here is how to do what you
seek!

In your GoToRecord action, set the Record argument to Go To. Set the Offset
argument to
[Forms]![FormName]![CombobBoxName]

--
Ken Snell
<MS ACCESS MVP>

Sorry. Try putting an = sign in front of the expression:

= [Forms]![FormName]![CombobBoxName] - 1

--
Ken Snell
<MS ACCESS MVP>

May said:
Thanks, I really appreciate your help but it did not seem
to work. The error message says Offset needs a number,
although I know an expression can be put in it. Tried
putting this macro in the form action, detail, combo box
itself, none worked. I tried GoToControl along with
GoToRecord with no success.
Values in combo box are unique (is primary key). 12 boxes
need data input by user to populate the corresponding
records.
The 12 text boxes are still showing the first record. I am
still forced to use the Record Number box to navigate
through records.
Choosing a value in record # 2 for eg. is not forcing the
rest of the objects and textboxes to point to record # 2
of the table.
I will really appreciate any further help. Thanks

-----Original Message-----
Haven't tested it but this should work:

In your GoToRecord action, set the Record argument to
First. Set the Offset
argument to
[Forms]![FormName]![CombobBoxName] - 1

where FormName and ComboBoxName need to be replaced by
your actual names.

Let me know if this does/doesn't work.

--
Ken Snell
<MS ACCESS MVP>

Hi,
I have a form with a combobox that shows all records of
one field of a table, And a host of other text boxes.
The
user picks a value from the dropdown combo box, then
fills
in other values in all the text boxes, thus populating
each record of that table.
Problem: The form seems to be in the first record mode
even though user chooses 2nd, 3rd or nth record, unless
he
uses the record number box at the bottom.
How can I make the form point to the record number of
the
value that is chosen in the combobox? If it is
GoToRecord
macro then, the macro should point to which event? and
what should ObjectType, ObjectName, Record and Offset
point to?
Appreciate help. Thanks in advance.


.


.
 
K

Ken Snell

Good luck! And you're welcome.

May said:
Thank You very much. I am very grateful for your help. I
think it is working fine now. I have not worked with
Access for long. Still learning. Thanks.

-----Original Message-----
Sorry again. Finally got chance to test, and here is how to do what you
seek!

In your GoToRecord action, set the Record argument to Go To. Set the Offset
argument to
[Forms]![FormName]![CombobBoxName]

--
Ken Snell
<MS ACCESS MVP>

Sorry. Try putting an = sign in front of the expression:

= [Forms]![FormName]![CombobBoxName] - 1

--
Ken Snell
<MS ACCESS MVP>

Thanks, I really appreciate your help but it did not seem
to work. The error message says Offset needs a number,
although I know an expression can be put in it. Tried
putting this macro in the form action, detail, combo box
itself, none worked. I tried GoToControl along with
GoToRecord with no success.
Values in combo box are unique (is primary key). 12 boxes
need data input by user to populate the corresponding
records.
The 12 text boxes are still showing the first record. I am
still forced to use the Record Number box to navigate
through records.
Choosing a value in record # 2 for eg. is not forcing the
rest of the objects and textboxes to point to record # 2
of the table.
I will really appreciate any further help. Thanks

-----Original Message-----
Haven't tested it but this should work:

In your GoToRecord action, set the Record argument to
First. Set the Offset
argument to
[Forms]![FormName]![CombobBoxName] - 1

where FormName and ComboBoxName need to be replaced by
your actual names.

Let me know if this does/doesn't work.

--
Ken Snell
<MS ACCESS MVP>

Hi,
I have a form with a combobox that shows all records of
one field of a table, And a host of other text boxes.
The
user picks a value from the dropdown combo box, then
fills
in other values in all the text boxes, thus populating
each record of that table.
Problem: The form seems to be in the first record mode
even though user chooses 2nd, 3rd or nth record, unless
he
uses the record number box at the bottom.
How can I make the form point to the record number of
the
value that is chosen in the combobox? If it is
GoToRecord
macro then, the macro should point to which event? and
what should ObjectType, ObjectName, Record and Offset
point to?
Appreciate help. Thanks in advance.


.


.
 

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