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

show all but current record

Status
Not open for further replies.

Superguppie

Technical User
Jan 19, 2005
107
NL
a record is opened, and that form also opens a subform, there is showed all record for the same person. but it must not show the record that is also showed in the normal form.

so if textbox"ticketnummer" = 15

then all record must show in the subform except for record with ticketnummer 15

how is that done
can someone guide a blind guppie to its destination:s

Thanks in advance:D

superguppie
 
You can set the record source of the subform in the current event of the form:

strSQL="SELECT a, b, c FROM tblT WHERE ID<>" & Me.ID
Me.SubformControlName.Form.RecordSource=strSQL


Or you can set up the SQL of the subform to reference the main form in a similar way.
 
this is SQL code right?

Im not so good an Very new to SQL code,
Im better with a complete VBA code
is there one for this problem?
otherwise can someone explane how to do this right??

Thanks

Superguppie
 
Open your main form and the query design window. Add the table you want for the subform to the query window. Type into the criteria line under the ticketnummer field:

<>Forms![Name of main form].ticketnummer

Open the query. Does it show the data you want? If so, use it as the RecordSource for your subform.
 
Thanks:D

It works now, my boss is very happy again
Thanks for the help:D

Greetz

Superguppie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top