guys,
is the correct way to retrieve a value from within a table is as follows:
Me.Mis_Han.DefaultValue = """ & DMax(([Sapak_Tbl]![Mis_han])+1) & """
while [Sapak_tbl] is the Table anf [Mis_Han] is the field stored in the
table.
thanks.
Not particularly. You have a couple of errors.
This is a way to set the Default property of a textbox named Mis_Han
on a Form, not to "retrieve a value".
The errors:
The DMax() function takes three string arguments, of which the third
is optional; you've only given it one. If you want DMax() to return
the largest value of the field Mis_Han from Sapak_Tbl, the correct
syntax would be
DMax("[Mis_Han]", "[Sapak_Tbl]")
The third argument is not needed unless you want to apply criteria to
filter the records over which the maximum will be calculated.
Also, you have the quotemarks wrong; you should have """" (four
quotes) instead of three. Two consecutive " characters inside a "
delimited string translate to a single quotemark; if the largest value
of Mis_Han is 333, using four quotes will give you
Me.Mis_Han.DefaultValue = "334"