By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,162 Members | 992 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,162 IT Pros & Developers. It's quick & easy.

go to the next blank record in the table

P: n/a
How can i go to the next blank record in the table , such a blank
record exists ?
In my form Customers, i have a command button with the following
command :
DoCmd.GoToRecord , "", acNewRec
DoCmd.GoToControl "CompanyName"

The above command is OK, but i want to amend it somehow . Do to some
reasons the users click the button without entering a new customer,
and in this case the table contains a customerid without a
CompanyName. Therefore, my task is the following :

If in the table customers there are records having blank CompanyName,
then do not go to the next record, but go to the next blank record,
without CompanyName, in ascending order I imagine my code to do the
following :

If Is Null the first field from the table with blank CompanyName
Then
go to this blank record ( the first in ascending order)
Else
DoCmd.GoToRecord , "", acNewRec
DoCmd.GoToControl "CompanyName"
End If

If i succedd, then we will have no blank CompanyNames in our database.

Is it posible and can somebody help me ?
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Why not just check to see if the company name is entered before moving to
the next record?
Use IsNull() or If = "" against the appropriate form control and skip the
move if it is null or empty.

Mike Storr
www.veraccess.com

"Johm" <ke**@abv.bg> wrote in message
news:24**************************@posting.google.c om...
How can i go to the next blank record in the table , such a blank
record exists ?
In my form Customers, i have a command button with the following
command :
DoCmd.GoToRecord , "", acNewRec
DoCmd.GoToControl "CompanyName"

The above command is OK, but i want to amend it somehow . Do to some
reasons the users click the button without entering a new customer,
and in this case the table contains a customerid without a
CompanyName. Therefore, my task is the following :

If in the table customers there are records having blank CompanyName,
then do not go to the next record, but go to the next blank record,
without CompanyName, in ascending order I imagine my code to do the
following :

If Is Null the first field from the table with blank CompanyName
Then
go to this blank record ( the first in ascending order)
Else
DoCmd.GoToRecord , "", acNewRec
DoCmd.GoToControl "CompanyName"
End If

If i succedd, then we will have no blank CompanyNames in our database.

Is it posible and can somebody help me ?

Nov 12 '05 #2

P: n/a
Johm wrote:
If in the table customers there are records having blank CompanyName,
then do not go to the next record, but go to the next blank record,
without CompanyName, in ascending order I imagine my code to do the
following : If i succeed, then we will have no blank CompanyNames in our database.

Is it posible and can somebody help me ?


You can make the CompanyName field required. I believe that is the
better solution.

--
Bas Cost Budde
http://www.heuveltop.org/BasCB
but the domain is nl

Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.