A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

combining field



 
 
Thread Tools Display Modes
  #1  
Old February 29th, 2008, 03:56 PM posted to microsoft.public.access.forms
[email protected]
external usenet poster
 
Posts: 22
Default combining field

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
  #2  
Old February 29th, 2008, 04:11 PM posted to microsoft.public.access.forms
Klatuu
external usenet poster
 
Posts: 7,074
Default combining field

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]
--
Dave Hargis, Microsoft Access MVP


" wrote:

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

  #3  
Old February 29th, 2008, 04:31 PM posted to microsoft.public.access.forms
[email protected]
external usenet poster
 
Posts: 22
Default combining field

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

  #4  
Old February 29th, 2008, 04:35 PM posted to microsoft.public.access.forms
[email protected]
external usenet poster
 
Posts: 22
Default combining field


figured out the prob its working no.. am soo chuffed
thanks
  #5  
Old February 29th, 2008, 04:39 PM posted to microsoft.public.access.forms
Klatuu
external usenet poster
 
Posts: 7,074
Default combining field

Is the form with lstSearch open and populated?
--
Dave Hargis, Microsoft Access MVP


" wrote:

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


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:13 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.