This Works:
Format(Now(),"yy") & "-" & (DMax("[number]","Birdsall_History_Table")+1)
These do not work:
Format(Now(),"yy") & "-" & (DMax("[number]","[HistoryTableValue]")+1)
Format(Now(),"yy") & "-" & (DMax("[number]",[HistoryTableValue])+1)
Format(Now(),"yy") & "-" & (DMax("[number]",
[Forms]![Switchboard]![HistoryTableValue])+1)
Format(Now(),"yy") & "-" & (DMax("[number]",
[Forms]![Switchboard].[HistoryTableValue])+1)
Format(Now(),"yy") & "-" & (DMax("[number]",
[Forms]![Switchboard]![HistoryTableValue].Value)+1)
Format(Now(),"yy") & "-" & (DMax("[number]",
[Forms]![Switchboard].[HistoryTableValue].Value)+1)
Format(Now(),"yy") & "-" & (DMax("[number]",
[Forms]![Switchboard]![HistoryTableValue].[Value])+1)
Format(Now(),"yy") & "-" &
(DMax("[number]","[Forms]![Switchboard]![HistoryTableValue].[Value]")+1)
Format(Now(),"yy") & "-" & (DMax("[number]",
"[Forms]![Switchboard]![HistoryTableValue]")+1)
Format(Now(),"yy") & "-" & (DMax("[number]",
"[Forms]![Switchboard].[HistoryTableValue]")+1)
Format(Now(),"yy") & "-" & (DMax("[number]",
"[Forms]![Switchboard]![HistoryTableValue].Value")+1)
Format(Now(),"yy") & "-" &
(DMax("[number]","
![HistoryTableValue]")+1)
Format(Now(),"yy") & "-" & (DMax([HistoryTableValuel]![number])+1)
Format(Now(),"yy") & "-" & (DMax("[number]","[HistoryTableValue]")+1)
Format(Now(),"yy") & "-" &
(DMax("[number]","[Tables]![HistoryTableValue]")+1)
Format(Now(),"yy") & "-" &
(DMax("[number]",[Tables]![HistoryTableValue])+1)
Format(Now(),"yy") & "-" & (DMax("[number]","[Tables].[HistoryTableValue]")+1)
Format(Now(),"yy") & "-" &
(DMax("[number]","[Tables]![HistoryTableValue].[Value]")+1)
	
		
			
				Joshua A. Booker said:
			
		
	
	
		
		
			Jim,
Perhaps the field name cannot be resolved in your context.  I Just
noticed
you are doing this in a macro.  Do you have a form open that has a field
bound to the HistoryTableValue field?  If so, try preceding it with the
form
name that it's from.
Format(Now(),"yy") & "-" & (DMax("[number]",
Forms!FormName![HistoryTableValue])+1)
HTH,
Josh
That is correct [HistoryTableValue] is a field that contains the name
of
the
table I want to run DMax on but it will not work with or without the
quotes.
:
Jim,
If I understand properly, [HistoryTableValue] is a field that
contains
the
name of the table you want to do the DMax on.  If so, lose the quotes
around
it like this:
Format(Now(),"yy") & "-" & (DMax("[number]",[HistoryTableValue])+1)
HTH,
Josh
I am transferring infomation from one form to another and need to
get
the
next available number from 1 of 5 tables. "HistoryTableValue" has
the
correct
table name in it but when I use it in a macro I get an action
failed
notice,
If I put in a table name it works.
Format(Now(),"yy") & "-" &
(DMax("[number]","[HistoryTableValue]")+1)