Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open a form with a specific record?

Status
Not open for further replies.

ov3rdr1ve

IS-IT--Management
Oct 20, 2004
32
US
I am trying to open a form and opening that form with a specific record... I am going this by hitting a command button.

This is what I have, but it is not working like I want.

Any Ideas?>

Thanks
Chance~

I am trying to open "frmIndividualReport" where jurornumber (a field in my table) is equal to the number 16

DoCmd.OpenForm "frmIndividualReport", , "[jurornumber] = '16'"
 
No Joy...

I think I need to call the table... something like this but I know this is not right? Any Ideas?

DoCmd.OpenForm "frmIndividualReport", , , tblmain, [JurorNumber] = 16

Thanks ...
Chance~
 
I meant for you to try:


DoCmd.OpenForm "frmIndividualReport", , "[jurornumber] = " & 16


Sorry I wasn't very clear.


 
That opens the form, but takes me to record 1?

Any other ideas?

Thanks!!

Maybe I need to call the table?
 
Sorry - I missed out a comma. I've just tested the following and it works.


DoCmd.OpenForm "frmIndividualReport", , , "[jurornumber] = " & 16


 
Maybe I am doing something wrong.

Here is my layout.

I have a bound form called frmMain and it is bound to tblMain.

I have another form called frmIndividualReport and it is bound to the same table tblmain.

I have a button on frmMain that I click and I want that button to take me to frmIndividualReport and have it go specifically to number 16 of jurornumber (which is a field in my table containing numbers.

Any thing you can think I am doing wrong?

Thanks
Chance~
 
How are ya ov3rdr1ve . . . . .

In . . .
Code:
[blue]DoCmd.OpenForm "frmIndividualReport", , , [purple][b]"[jurornumber] = " & 16[/b][/purple][/blue]
[purple]"[jurornumber] = " & 16[/purple] is a valid where clause and I'd expect it to work. Its no different than:
[purple]"[jurornumber] = 16"[/purple]
[ol][li] Is there an actual [purple][jurornumber] = 16[/purple] in the table? (double check the table . . .)[/li]
[li]In the form, check the spelling of [purple]jurornumber[/purple] for the controls [blue]Control Source property[/blue], and the controls [blue]Name[/blue] property.[/li][/ol]

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top