Choose record info using ComboBox

  • Thread starter Thread starter AntonioMachado
  • Start date Start date
A

AntonioMachado

I have tblProjects (Key = ProjectID)

I made a form (record source = tblPtojects) containing all the fields form
tblProjects

I want the user to pick a project using a combobox, and have the other fields
updated with the project's info, instead of navigating through projects using
the form buttons.

Currently, when I select a project in the combo, nothing happens.

What do I need?

Antonio.
 
AntonioMachado said:
I have tblProjects (Key = ProjectID)

I made a form (record source = tblPtojects) containing all the fields form
tblProjects

I want the user to pick a project using a combobox, and have the other
fields
updated with the project's info, instead of navigating through projects
using
the form buttons.

Currently, when I select a project in the combo, nothing happens.

What do I need?

Antonio.

Are you handling the combo box's AfterUpdate event? That's where you would
"jump" to the selected record. If you're using DAO, this is how you could do
it:

Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone
rs.FindFirst "ProjectID=" & Me.combobox
If Not rs.NoMatch Then
Me.Bookmark = rs.Bookmark
End If

Carl Rapson
 
Thank you Carl. Solved my problem.

But I'm new to Access. I don't know what DAO means, neither "& Me", nor
"rsBookmark"....

I don''t know much coding. What is a good source (internet, books...) for me
to learn the meanings, what each word and sentence do, so that I can learn to
think for myself when it comes to write code.

Is there any source where I can find example of standard codes? By standard I
mean codes that majority of developers need to use sometime. Like "code to
filter...." "code to update data using combobox"......?

thanks.


Where do I learn more about these codes?

Carl said:
I have tblProjects (Key = ProjectID)
[quoted text clipped - 12 lines]

Are you handling the combo box's AfterUpdate event? That's where you would
"jump" to the selected record. If you're using DAO, this is how you could do
it:

Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone
rs.FindFirst "ProjectID=" & Me.combobox
If Not rs.NoMatch Then
Me.Bookmark = rs.Bookmark
End If

Carl Rapson
 
Thank you Carl. Solved my problem.

But I'm new to Access. I don't know what DAO means, neither "& Me", nor
"rsBookmark"....

I don''t know much coding. What is a good source (internet, books...) for me
to learn the meanings, what each word and sentence do, so that I can learn to
think for myself when it comes to write code.

Is there any source where I can find example of standard codes? By standard I
mean codes that majority of developers need to use sometime. Like "code to
filter...." "code to update data using combobox"......?

thanks.


Where do I learn more about these codes?

Carl said:
I have tblProjects (Key = ProjectID)
[quoted text clipped - 12 lines]

Are you handling the combo box's AfterUpdate event? That's where you would
"jump" to the selected record. If you're using DAO, this is how you could do
it:

Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone
rs.FindFirst "ProjectID=" & Me.combobox
If Not rs.NoMatch Then
Me.Bookmark = rs.Bookmark
End If

Carl Rapson
 
It wouldn't hurt to get a reference book such as one of the Access Bible
series (currently on Access 2007, but previous versions should also be
available). There are many others, and you'll find that each developer
probably has preferred reference books. You can find such books on Amazon;
search for Microsoft Access books and check the description of each one. A
local community college or technical school might also offer a short course
on Access that could be useful; that might be a way to get a hands-on
introduction to Access VBA programming.

I've learned much of what I know right here in these newsgroups. If you have
a question, feel free to post it here. Just try to keep your questions
specific rather than general; people are here to help, not to do the work
for you. You can also search these newsgroups for specific keywords, such as
DAO or Me or Bookmark.

Several of the prominent regulars here maintain web sites that contain
tremendous amounts of tips and code samples that can help you. Here are some
of the ones I refer to frequently:

http://allenbrowne.com/tips.html

http://www.lebans.com/

http://www.mvps.org/access/

http://www.granite.ab.ca/accsmstr.htm

http://www.rogersaccesslibrary.com/

All of these people provide this at no charge (both the web sites and the
newgroup help). Remember to thank those that help you, and as you start to
learn more be sure to share your knowledge with others who are just
beginning.

HTH,

Carl Rapson

AntonioMachado via AccessMonster.com said:
Thank you Carl. Solved my problem.

But I'm new to Access. I don't know what DAO means, neither "& Me", nor
"rsBookmark"....

I don''t know much coding. What is a good source (internet, books...) for
me
to learn the meanings, what each word and sentence do, so that I can learn
to
think for myself when it comes to write code.

Is there any source where I can find example of standard codes? By
standard I
mean codes that majority of developers need to use sometime. Like "code to
filter...." "code to update data using combobox"......?

thanks.


Where do I learn more about these codes?

Carl said:
I have tblProjects (Key = ProjectID)
[quoted text clipped - 12 lines]

Are you handling the combo box's AfterUpdate event? That's where you would
"jump" to the selected record. If you're using DAO, this is how you could
do
it:

Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone
rs.FindFirst "ProjectID=" & Me.combobox
If Not rs.NoMatch Then
Me.Bookmark = rs.Bookmark
End If

Carl Rapson
 
Thank you very much for all the info. I'll search for books on Amazon and
check out the web sites you mention.

Valuable info! thanks again.
Antonio.



Carl said:
It wouldn't hurt to get a reference book such as one of the Access Bible
series (currently on Access 2007, but previous versions should also be
available). There are many others, and you'll find that each developer
probably has preferred reference books. You can find such books on Amazon;
search for Microsoft Access books and check the description of each one. A
local community college or technical school might also offer a short course
on Access that could be useful; that might be a way to get a hands-on
introduction to Access VBA programming.

I've learned much of what I know right here in these newsgroups. If you have
a question, feel free to post it here. Just try to keep your questions
specific rather than general; people are here to help, not to do the work
for you. You can also search these newsgroups for specific keywords, such as
DAO or Me or Bookmark.

Several of the prominent regulars here maintain web sites that contain
tremendous amounts of tips and code samples that can help you. Here are some
of the ones I refer to frequently:

http://allenbrowne.com/tips.html

http://www.lebans.com/

http://www.mvps.org/access/

http://www.granite.ab.ca/accsmstr.htm

http://www.rogersaccesslibrary.com/

All of these people provide this at no charge (both the web sites and the
newgroup help). Remember to thank those that help you, and as you start to
learn more be sure to share your knowledge with others who are just
beginning.

HTH,

Carl Rapson
Thank you Carl. Solved my problem.
[quoted text clipped - 35 lines]
 
Back
Top