Connecting Tech Pros Worldwide Help | Site Map
 
 
LinkBack Thread Tools Search this Thread
  #1  
Old November 12th, 2005, 03:01 PM
TTD_hck
Guest
 
Posts: n/a
Default How to get value from a query or table?

Hello,

I'm kinda new to this, and any help would be very welcome.

When I open a form (which is linked to table A), I want to perform a query
on that same table.

I need to know the max of field 'HUB' and want to add it with 1. This
value(MyVar) I want to show on the form, so that I know which HUB number I
can enter. (I'm not working with autonum on this table).

Which script do I have to write.

It is something like:

MyVar = Max(TableA.HUB)+1


Thanks for your time and attention.


  #2  
Old November 12th, 2005, 03:02 PM
Fletcher Arnold
Guest
 
Posts: n/a
Default Re: How to get value from a query or table?

"TTD_hck" <ttd@hotmail.com> wrote in message
news:blr9hs$207u$1@beast.euro.net...[color=blue]
> Hello,
>
> I'm kinda new to this, and any help would be very welcome.
>
> When I open a form (which is linked to table A), I want to perform a query
> on that same table.
>
> I need to know the max of field 'HUB' and want to add it with 1. This
> value(MyVar) I want to show on the form, so that I know which HUB number I
> can enter. (I'm not working with autonum on this table).
>
> Which script do I have to write.
>
> It is something like:
>
> MyVar = Max(TableA.HUB)+1
>
>
> Thanks for your time and attention.[/color]


Try the DMAX function:

=DMax("[HUB]","TableA") + 1


Fletcher



  #3  
Old November 12th, 2005, 03:02 PM
TTD_hck
Guest
 
Posts: n/a
Default Re: How to get value from a query or table?

Thanks,

works very well.


"Fletcher Arnold" <fletch@home.com> schreef in bericht
news:blrdm0$oc9$1@sparta.btinternet.com...[color=blue]
> "TTD_hck" <ttd@hotmail.com> wrote in message
> news:blr9hs$207u$1@beast.euro.net...[color=green]
> > Hello,
> >
> > I'm kinda new to this, and any help would be very welcome.
> >
> > When I open a form (which is linked to table A), I want to perform a[/color][/color]
query[color=blue][color=green]
> > on that same table.
> >
> > I need to know the max of field 'HUB' and want to add it with 1. This
> > value(MyVar) I want to show on the form, so that I know which HUB number[/color][/color]
I[color=blue][color=green]
> > can enter. (I'm not working with autonum on this table).
> >
> > Which script do I have to write.
> >
> > It is something like:
> >
> > MyVar = Max(TableA.HUB)+1
> >
> >
> > Thanks for your time and attention.[/color]
>
>
> Try the DMAX function:
>
> =DMax("[HUB]","TableA") + 1
>
>
> Fletcher
>
>
>[/color]


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 205,248 network members.