Form ??

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a data entry form that is linked to my PO Log Table. I made a
"search" type form to key in the PO number with a command button to pull that
record up on my data entry form for editing. When I key a PO number in the
"search " form, it pulls up the right record, but any changes I make to that
record are made to the first record in my table. I am not sure why it is
doing this. I hope this makes sense!
thanks in advance :)
 
I wish I could but I got mad and deleted it...lol. Sorry.
I just built the form with the wizard and had a textbox linked to the PO #
column on my table. Then I used the command button wizard to "openform" that
matched the textbox. I hope this helps....
 
Hi

Bit confused are your wanting to find a record on the form that is already
open or are you want to open a new at a specific record - have to ask as the
codes are different.
 
Well, I would like to open the specific record so that I can edit the
information.
Does that make sense?
 
Do you have a form already open and you want to go to a record "on the same
form"
Or
Do you want to open a "different form" at a specific record.
 
open a "different form" at a specific record.

Wayne-I-M said:
Do you have a form already open and you want to go to a record "on the same
form"
Or
Do you want to open a "different form" at a specific record.
 
Create a button
Place this behind the OnClick event

Private Sub ButtonName_Click()
DoCmd.OpenForm "FormName2", acNormal, "",
"[Forms]![FormName1]![Field1]=[Field2]", , acNormal
End Sub


Form1 = Is the form you are working on at the moment
Form 2 = Is the form you want to open
Field 1 = This is the field on form1 that you want to use a crieria
Field 2 = This is the linking field on form2 (could be ID field but must be
on both forms)
Change ButtonName to what you have called your button
 
Private Sub prsearch_Click()

DoCmd.OpenForm "PO Form", acNormal, "",

"[Forms]![PR search]![PR Number]=[PR Number]", , acNormal

End Sub

I am getting a syntax error on this? Did I not put something in right?

Wayne-I-M said:
Create a button
Place this behind the OnClick event

Private Sub ButtonName_Click()
DoCmd.OpenForm "FormName2", acNormal, "",
"[Forms]![FormName1]![Field1]=[Field2]", , acNormal
End Sub


Form1 = Is the form you are working on at the moment
Form 2 = Is the form you want to open
Field 1 = This is the field on form1 that you want to use a crieria
Field 2 = This is the linking field on form2 (could be ID field but must be
on both forms)
Change ButtonName to what you have called your button


--
Wayne
Manchester, England.



frustratedwthis said:
open a "different form" at a specific record.
 
Try using

DoCmd.OpenForm "PO Form", acNormal, _
"", "[PR Number] = " & _
[Forms]![PR search]![PR Number], , acNormal

if PR Number is numeric, or

DoCmd.OpenForm "PO Form", acNormal, _
"", "[PR Number] = '" & _
[Forms]![PR search]![PR Number] & "'", , acNormal

Exagerated for clarity, that second one is

DoCmd.OpenForm "PO Form", acNormal, _
"", "[PR Number] = ' " & _
[Forms]![PR search]![PR Number] & " ' ", , acNormal

I've used line continuation characters in an attempt to ensure that
word-wrap doesn't cause confusion.
 
I tried both of these and they do bring up my form but it is blank. It isn't
the record I am looking for.

Douglas J. Steele said:
Try using

DoCmd.OpenForm "PO Form", acNormal, _
"", "[PR Number] = " & _
[Forms]![PR search]![PR Number], , acNormal

if PR Number is numeric, or

DoCmd.OpenForm "PO Form", acNormal, _
"", "[PR Number] = '" & _
[Forms]![PR search]![PR Number] & "'", , acNormal

Exagerated for clarity, that second one is

DoCmd.OpenForm "PO Form", acNormal, _
"", "[PR Number] = ' " & _
[Forms]![PR search]![PR Number] & " ' ", , acNormal

I've used line continuation characters in an attempt to ensure that
word-wrap doesn't cause confusion.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


frustratedwthis said:
Private Sub prsearch_Click()

DoCmd.OpenForm "PO Form", acNormal, "",

"[Forms]![PR search]![PR Number]=[PR Number]", , acNormal

End Sub

I am getting a syntax error on this? Did I not put something in right?
 

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

Back
Top