try again get values from another tabel

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

Guest

If i have this
start = date()

do while start <= slut

here i want to lookup in another tabel to se if the value of start is in
this table
something like
if start = then

start = start+1
loop
hope i have explain it right

Alvin
 
I dont know the criteria you want to use looking for that date field in the
table, if there is only one value, then drop the criteria.

Try this
start = Nz(Dlookup("Start","TableName","Insert the Criteria here"),Date())+1

If the value wont be found in the table, then the NZ functiob will assign
the date() to the Start
 
Hi Thanks
Let us say this

i have 2 dates
start = "09-19-2005"
slut = "09-25-2005"

then i loop
do while start <= slut

Now i want to se how many times start is in another table
in this table there are many dates.

then i take start and say
start = start +1
loop

so first start = 09-19-2005 in second loop start = 10-10-2005 and so on

Hope you can understand me

Alvin





"Ofer" skrev:
 
Try this, I hope it will provide you with a start

Function FunctionName()
Dim start As Variant, slut As Variant

start = "09-19-2005"
slut = "09-25-2005"

' Loop + convert to date
Do While CVDate(start) <= CVDate(slut)
' will display a message with the amount of time the date apear in the
table
MsgBox DCount("start", "TableName", "start = #" & start & "#")
' Add a day to the date
start = CVDate(start) + 1
Loop

End Function
 
Back
Top