Accessing a form component i a query

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

Guest

Hello

Is it possible to access the text property on a textbox and us it in a query?

I have inherited this access database and it doesn't work, it simply pop-up
an input box where the query needs data from a textbox (tekst28) on a form.


SELECT TOP 1 [Tegn-ID].[Tegn nr], [Tegn-version].[Version nr],
[Tegn-version].Udstedt, [Tegn-version].Initialer, [Tegn-ID].ProjNr,
Projektdata.[Projekt navn]
FROM ([Tegn-ID] LEFT JOIN Projektdata ON [Tegn-ID].ProjNr =
Projektdata.[Ordre nr]) LEFT JOIN [Tegn-version] ON [Tegn-ID].[Tegn nr] =
[Tegn-version].[Tegn nr]
WHERE ((([Tegn-ID].[Tegn nr])="I/O-Disp-" &
[Formularer]![IO_Liste_Main]![Tekst28]))
ORDER BY [Tegn-version].[Version nr] DESC;


Isolated this is the problem
="I/O-Disp-" & [Formularer]![IO_Liste_Main]![Tekst28]))

isn't it possible to do that somehow?
 
That should work AS LONG AS you have the form open and there is no
misspelling of the form's name or the control's name.

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
Hi

Thanks John, but I get an inputbox instead and the form is actually open,
any suggestions?

cheers
Henry


--
Henry


John Spencer said:
That should work AS LONG AS you have the form open and there is no
misspelling of the form's name or the control's name.

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

Henry said:
Hello

Is it possible to access the text property on a textbox and us it in a
query?

I have inherited this access database and it doesn't work, it simply
pop-up
an input box where the query needs data from a textbox (tekst28) on a
form.


SELECT TOP 1 [Tegn-ID].[Tegn nr], [Tegn-version].[Version nr],
[Tegn-version].Udstedt, [Tegn-version].Initialer, [Tegn-ID].ProjNr,
Projektdata.[Projekt navn]
FROM ([Tegn-ID] LEFT JOIN Projektdata ON [Tegn-ID].ProjNr =
Projektdata.[Ordre nr]) LEFT JOIN [Tegn-version] ON [Tegn-ID].[Tegn nr] =
[Tegn-version].[Tegn nr]
WHERE ((([Tegn-ID].[Tegn nr])="I/O-Disp-" &
[Formularer]![IO_Liste_Main]![Tekst28]))
ORDER BY [Tegn-version].[Version nr] DESC;


Isolated this is the problem
="I/O-Disp-" & [Formularer]![IO_Liste_Main]![Tekst28]))

isn't it possible to do that somehow?
 
Sorry, You are right, it works if it's spelled correct - should be [Forms] -
not [Formular] ;o)

thanks

--
Henry


John Spencer said:
That should work AS LONG AS you have the form open and there is no
misspelling of the form's name or the control's name.

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

Henry said:
Hello

Is it possible to access the text property on a textbox and us it in a
query?

I have inherited this access database and it doesn't work, it simply
pop-up
an input box where the query needs data from a textbox (tekst28) on a
form.


SELECT TOP 1 [Tegn-ID].[Tegn nr], [Tegn-version].[Version nr],
[Tegn-version].Udstedt, [Tegn-version].Initialer, [Tegn-ID].ProjNr,
Projektdata.[Projekt navn]
FROM ([Tegn-ID] LEFT JOIN Projektdata ON [Tegn-ID].ProjNr =
Projektdata.[Ordre nr]) LEFT JOIN [Tegn-version] ON [Tegn-ID].[Tegn nr] =
[Tegn-version].[Tegn nr]
WHERE ((([Tegn-ID].[Tegn nr])="I/O-Disp-" &
[Formularer]![IO_Liste_Main]![Tekst28]))
ORDER BY [Tegn-version].[Version nr] DESC;


Isolated this is the problem
="I/O-Disp-" & [Formularer]![IO_Liste_Main]![Tekst28]))

isn't it possible to do that somehow?
 
Only that you double-check the spelling of the form Name and control Name.
IF you've done that, then I can only suggest that you rebuild the query.
(Simplest method to do that, is to open the query in SQL view, Copy the SQL
text and paste it into a new blank query.)

If you have used any of the query properties, you will have to set those
manually.

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

Henry said:
Hi

Thanks John, but I get an inputbox instead and the form is actually open,
any suggestions?

cheers
Henry


--
Henry


John Spencer said:
That should work AS LONG AS you have the form open and there is no
misspelling of the form's name or the control's name.

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

Henry said:
Hello

Is it possible to access the text property on a textbox and us it in a
query?

I have inherited this access database and it doesn't work, it simply
pop-up
an input box where the query needs data from a textbox (tekst28) on a
form.


SELECT TOP 1 [Tegn-ID].[Tegn nr], [Tegn-version].[Version nr],
[Tegn-version].Udstedt, [Tegn-version].Initialer, [Tegn-ID].ProjNr,
Projektdata.[Projekt navn]
FROM ([Tegn-ID] LEFT JOIN Projektdata ON [Tegn-ID].ProjNr =
Projektdata.[Ordre nr]) LEFT JOIN [Tegn-version] ON [Tegn-ID].[Tegn nr]
=
[Tegn-version].[Tegn nr]
WHERE ((([Tegn-ID].[Tegn nr])="I/O-Disp-" &
[Formularer]![IO_Liste_Main]![Tekst28]))
ORDER BY [Tegn-version].[Version nr] DESC;


Isolated this is the problem
="I/O-Disp-" & [Formularer]![IO_Liste_Main]![Tekst28]))

isn't it possible to do that somehow?
 
Back
Top