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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Client_num on screen 1, need record on subform of screen 2

Status
Not open for further replies.

roddy17

Technical User
Jul 27, 2001
49
CA
hi there,
i do appreciate the tips and efforts of all who respond to the questions posed everyday. This is a great site.
Now, i've got a form where the user enters a client_num and that's it. Then upon hitting enter, i would like to see the client_num and client_name showing up in a second form, along with the rest of related data in the subform which is within the second form.
here is the code that i have been trying.

Private Sub cmdOpenEntryScreen_Click()
On Error GoTo Err_cmdOpenEntryScreen_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "ENTRY FORM"
stLinkCriteria = "CLIENT_NUMBER"
stLinkCriteria = "([CLIENT_NUMBER])= '" & Me![txtClientNumber] & "'"
'Me.Bookmark = Me.RecordsetClone.Bookmark
'DoCmd.OpenForm stDocName, , , stLinkCriteria
'txtClientNumber = ""
Forms.stDocName.Form![CLIENT_NUMBER] = Me![CLIENT_NUMBER]

Exit_cmdOpenEntryScreen_Click:

Exit Sub

Err_cmdOpenEntryScreen_Click:
MsgBox Err.Description
Resume Exit_cmdOpenEntryScreen_Click

End Sub

The code that i have commented out was what i first tried to use (along with the code above it). The line "Forms.stDocName.Form![CLIENT_NUMBER] = Me!" was another try to solve this.

Your help is greatly appreciated. Thanks.
 
I would put two unbound textboxes on the subform and in the control source for those textboxes put
=forms![Entry Form]![red][client_name][/red]
and in the other
=forms![Entry Form]![red][client_number][/red]
The two fields that are red need to be named the same as the text boxes on the main form "Entry Form".

This will display the client_name and the client_number on the subform but that is all it will do, it will not put that value in the table that the subform is coming from. You also need to make sure that the subform is displaying the correct information (that pertains to the customer number and customer name). The only reason that I say this is because it looks like you are trying to establish a link criteria and I am not sure why!

Hope This Helps!
Sera
 
Thankyou for your speedy reply.
I have gone and implemented what you suggested. If I had established a link criteria, it was by accident because i'm not sure what it is.
anyway, now i've tried to see if the update works. When i enter a client number on the ClientNum Form and hit enter, i get this message from Access that 'Object doesn't support this property or method'.
Is there something else that i need to change or get rid of in the code above?
 
Okay where did you put the code? The code should go in the control source
part of the properties window. Is this where you put it?
Sera
 
I am going home for the day so I will have to talk to you about this Monday. I worked up an example database that I can send to you Monday morning. If you would like me to do this then e-mail me at
white_sera@hotmail.com
and I will promptly send you the database with a short description of what I did!
Sera
 
Hi
I am having the same problem! I want to be able to choose a project in an entry form and then have different fields show up for that project in other forms. Sera, could you please email me a sample too?
Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top