Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / February 2008

Tip: Looking for answers? Try searching our database.

combining field

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
fiona.innes@metacor.co.uk - 29 Feb 2008 15:56 GMT
Hi

I have a table called tblDetails and in this table there are 2 field
called strGateID (autonumber) and srtPN which is a default value of
PN. I have combined two field in a query called qrySearch and the new
field is called srtSearchNo.
On my main page frmMain I have a listbox (lstSearch) this displays all
the data in the tblDetails via the qrySearch. When I double click on a
record in the list box I wish it to display all the relevant date on a
new form called frmResults.

Private Sub ShowRecord_Click()

'Find a selected record, then close the search dialog box

   DoCmd.OpenForm "frmResults1", , , _

    "[qrySearch.strSearchNo]=" & "'" & Me.lstSearch.Column(2) & "'"

    'Close the dialog box

   DoCmd.Close acForm, "frmMain"

End Sub

only problem is when I run the search it comes up with an error saying

Run-Time errror '3126'
Invalid bracketing of name '[qrySearch.srtSearchNo]

does anyone know how to resolve this?

Thank

Fiona
Klatuu - 29 Feb 2008 16:11 GMT
In this context, you don't include the query name,just the field name.  Also,
even if you were using a context that required the query name, the syntax is
incorrect:

Sould be:
"[strSearchNo]="

Correct syntax for recordset use:
[qrySearch].[strSearchNo]
Signature

Dave Hargis, Microsoft Access MVP

> Hi
>
[quoted text clipped - 31 lines]
>
> Fiona
fiona.innes@metacor.co.uk - 29 Feb 2008 16:31 GMT
hi,

Iv added that code and now its coming up with a parameter value box
with qrySearch.strSearchNo  so i take it its looking for some sort of
values
or somit.. why is this occuring
Klatuu - 29 Feb 2008 16:39 GMT
Is the form with lstSearch open and populated?
Signature

Dave Hargis, Microsoft Access MVP

> hi,
>
> Iv added that code and now its coming up with a parameter value box
> with qrySearch.strSearchNo  so i take it its looking for some sort of
> values
> or somit.. why is this occuring
fiona.innes@metacor.co.uk - 29 Feb 2008 16:35 GMT
figured out the prob its working no.. am soo chuffed
thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.