Bind a Field from External Table

  • Thread starter Thread starter JethroUK©
  • Start date Start date
J

JethroUK©

How do I bind a textboxt to a field from another table (not the table that's
bound to the form)

Tried:

=Table1![Next ISA]

=CurrentDb.TableDefs("table1").Fields ("nextisa")

I'm actually just trying to save a value such that it will survive close and
reopening of the database (so i can continue where i left off)

I have read a post (MVP) that suggests building a seperate 'variables'
form - binding the variables to some textboxes - opening it hidden before
opening the main form - but surely there must be easier ways of retaining a
variable

any clues?
 
Is there only a single row in that table?

You can use =DLookup("nextisa", "table1") if so.

Otherwise, create a query that adds table1 to the recordset that's bound to
the form.
 
there's only 1 field - it still genrates an error - p.s. it's in the header
if that makes a diff, although it still errors if i move it to the detail -
i've tried it with the table1 open & closed (not sure whether that affects
it)

if i add the field in a query - it will appear in every record which seems
weird ( i want to add some more constant variables)

is it so that you can't store a single value in an Access form (unless it
appears in every record of the bound set)? - so i'm wasting my time looking
for methods


Douglas J Steele said:
Is there only a single row in that table?

You can use =DLookup("nextisa", "table1") if so.

Otherwise, create a query that adds table1 to the recordset that's bound to
the form.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


JethroUK© said:
How do I bind a textboxt to a field from another table (not the table that's
bound to the form)

Tried:

=Table1![Next ISA]

=CurrentDb.TableDefs("table1").Fields ("nextisa")

I'm actually just trying to save a value such that it will survive close and
reopening of the database (so i can continue where i left off)

I have read a post (MVP) that suggests building a seperate 'variables'
form - binding the variables to some textboxes - opening it hidden before
opening the main form - but surely there must be easier ways of
retaining
a
variable

any clues?
 
p.s. previously i used to store values in the objects .tag property at run
time - but even saving the form using 'acSaveYes' it loses the values?


JethroUK© said:
there's only 1 field - it still genrates an error - p.s. it's in the header
if that makes a diff, although it still errors if i move it to the detail -
i've tried it with the table1 open & closed (not sure whether that affects
it)

if i add the field in a query - it will appear in every record which seems
weird ( i want to add some more constant variables)

is it so that you can't store a single value in an Access form (unless it
appears in every record of the bound set)? - so i'm wasting my time looking
for methods


Douglas J Steele said:
Is there only a single row in that table?

You can use =DLookup("nextisa", "table1") if so.

Otherwise, create a query that adds table1 to the recordset that's bound to
the form.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


JethroUK© said:
How do I bind a textboxt to a field from another table (not the table that's
bound to the form)

Tried:

=Table1![Next ISA]

=CurrentDb.TableDefs("table1").Fields ("nextisa")

I'm actually just trying to save a value such that it will survive
close
and
reopening of the database (so i can continue where i left off)

I have read a post (MVP) that suggests building a seperate 'variables'
form - binding the variables to some textboxes - opening it hidden before
opening the main form - but surely there must be easier ways of
retaining
a
variable

any clues?
 
You can't store ANY values in a form: values are stored in tables.

Now, in one place you had the field name with a space in it, in the other
place, you didn't.

If the field name has a space in it (normally not recommended, by the way),
make sure you put it in the DLookup statement.

=DLookup("[Next ISA]", "[Table1]")

If you're still getting an error, go to the Immediate window (Ctrl-G), type

?DLookup("[Next ISA]", "[Table1]")

and hit enter. Do you get a value then?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



JethroUK© said:
there's only 1 field - it still genrates an error - p.s. it's in the
header
if that makes a diff, although it still errors if i move it to the
detail -
i've tried it with the table1 open & closed (not sure whether that affects
it)

if i add the field in a query - it will appear in every record which seems
weird ( i want to add some more constant variables)

is it so that you can't store a single value in an Access form (unless it
appears in every record of the bound set)? - so i'm wasting my time
looking
for methods


Douglas J Steele said:
Is there only a single row in that table?

You can use =DLookup("nextisa", "table1") if so.

Otherwise, create a query that adds table1 to the recordset that's bound to
the form.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


JethroUK© said:
How do I bind a textboxt to a field from another table (not the table that's
bound to the form)

Tried:

=Table1![Next ISA]

=CurrentDb.TableDefs("table1").Fields ("nextisa")

I'm actually just trying to save a value such that it will survive
close and
reopening of the database (so i can continue where i left off)

I have read a post (MVP) that suggests building a seperate 'variables'
form - binding the variables to some textboxes - opening it hidden before
opening the main form - but surely there must be easier ways of
retaining
a
variable

any clues?
 
that fine worked - thanx



Douglas J. Steele said:
You can't store ANY values in a form: values are stored in tables.

Now, in one place you had the field name with a space in it, in the other
place, you didn't.

If the field name has a space in it (normally not recommended, by the way),
make sure you put it in the DLookup statement.

=DLookup("[Next ISA]", "[Table1]")

If you're still getting an error, go to the Immediate window (Ctrl-G), type

?DLookup("[Next ISA]", "[Table1]")

and hit enter. Do you get a value then?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



JethroUK© said:
there's only 1 field - it still genrates an error - p.s. it's in the
header
if that makes a diff, although it still errors if i move it to the
detail -
i've tried it with the table1 open & closed (not sure whether that affects
it)

if i add the field in a query - it will appear in every record which seems
weird ( i want to add some more constant variables)

is it so that you can't store a single value in an Access form (unless it
appears in every record of the bound set)? - so i'm wasting my time
looking
for methods


Douglas J Steele said:
Is there only a single row in that table?

You can use =DLookup("nextisa", "table1") if so.

Otherwise, create a query that adds table1 to the recordset that's
bound
to
the form.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


How do I bind a textboxt to a field from another table (not the table
that's
bound to the form)

Tried:

=Table1![Next ISA]

=CurrentDb.TableDefs("table1").Fields ("nextisa")

I'm actually just trying to save a value such that it will survive
close
and
reopening of the database (so i can continue where i left off)

I have read a post (MVP) that suggests building a seperate 'variables'
form - binding the variables to some textboxes - opening it hidden before
opening the main form - but surely there must be easier ways of retaining
a
variable

any clues?
 
or even 'that worked fine - thanx'

i'm often typing letters wrong way round (and i leave out some words on
purpose, 'a's and 'the's ) - but that's first time i typed whole words wrong
way round - looks like i'm on the slippery slopes to spoonerisms - or would
that be "that wine forked - thanx" :o)

JethroUK© said:
that fine worked - thanx



Douglas J. Steele said:
You can't store ANY values in a form: values are stored in tables.

Now, in one place you had the field name with a space in it, in the other
place, you didn't.

If the field name has a space in it (normally not recommended, by the way),
make sure you put it in the DLookup statement.

=DLookup("[Next ISA]", "[Table1]")

If you're still getting an error, go to the Immediate window (Ctrl-G), type

?DLookup("[Next ISA]", "[Table1]")

and hit enter. Do you get a value then?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



JethroUK© said:
there's only 1 field - it still genrates an error - p.s. it's in the
header
if that makes a diff, although it still errors if i move it to the
detail -
i've tried it with the table1 open & closed (not sure whether that affects
it)

if i add the field in a query - it will appear in every record which seems
weird ( i want to add some more constant variables)

is it so that you can't store a single value in an Access form (unless it
appears in every record of the bound set)? - so i'm wasting my time
looking
for methods


Is there only a single row in that table?

You can use =DLookup("nextisa", "table1") if so.

Otherwise, create a query that adds table1 to the recordset that's bound
to
the form.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


How do I bind a textboxt to a field from another table (not the table
that's
bound to the form)

Tried:

=Table1![Next ISA]

=CurrentDb.TableDefs("table1").Fields ("nextisa")

I'm actually just trying to save a value such that it will survive
close
and
reopening of the database (so i can continue where i left off)

I have read a post (MVP) that suggests building a seperate 'variables'
form - binding the variables to some textboxes - opening it hidden
before
opening the main form - but surely there must be easier ways of
retaining
a
variable

any clues?
 
Back
Top