Re: Loading a particular record into a form via a command button
From: Marshall Barton (marshbarton_at_wowway.com)
Date: 12/07/04
- Next message: Stephen Knapp: "RE: Comparing Recordsets"
- Previous message: John Vinson: "Re: Where condition question"
- In reply to: ndunwoodie: "Re: Loading a particular record into a form via a command button"
- Next in thread: ndunwoodie: "Re: Loading a particular record into a form via a command button"
- Reply: ndunwoodie: "Re: Loading a particular record into a form via a command button"
- Reply: ndunwoodie: "Re: Loading a particular record into a form via a command button"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 07 Dec 2004 11:39:47 -0600
Do you have any code for the button? The button wizard will
generate most of it for you. Once you have that, modify it
to include what I posted. If you can't figure out to make
the changes, at least post a Copy/Paste of the code that you
do have.
You have created to other form, right? The form has a table
or a query as its record source, right? Basically, if you
open the form from that database window, it should show you
all the records in the tabe/query. When you open it using
the button's Click event code, it should filter the records
to the one with the selected name.
If that's still not enough to get you going, it would help
if you provided more details about the form, the combo box
and the table/query.
-- Marsh MVP [MS Access] ndunwoodie wrote: >Sorry, but this didn't help. Perhaps I just don't understand Access well >enough.. I want to do this... 1. Pick a name from a combo box 2. Click a >command button - the command button will use the name from the combo box to >load the record which has the same name in one of it's fields (I made it a >key field) in a particular table into a particular form. I'm sorry, but I'm >just not clear as to how to code the button to grab all the other fields from >this record as well as the one with the same name as the combo box and put >them into the form > >"Marshall Barton" wrote: >> Ok. For this question (as opposed to your original >> question), I recommend that you use the OpenForm method's >> WhereCondition argument. Still assuming that the keyfield is >> a Text type field, the button's Click event procedure would >> include code something like this: >> >> Dim strWhere As String >> strWhere = "[namefield] = """ & Me.combo & """" >> DoCmd.OpenForm "nameofform", , , strWhere
- Next message: Stephen Knapp: "RE: Comparing Recordsets"
- Previous message: John Vinson: "Re: Where condition question"
- In reply to: ndunwoodie: "Re: Loading a particular record into a form via a command button"
- Next in thread: ndunwoodie: "Re: Loading a particular record into a form via a command button"
- Reply: ndunwoodie: "Re: Loading a particular record into a form via a command button"
- Reply: ndunwoodie: "Re: Loading a particular record into a form via a command button"
- Messages sorted by: [ date ] [ thread ]