As OMG Ponies already said - you cannot create fk constraints across databases, but if those are just odd table names with dots in them (highly discouraged! since SQL Server already uses a dotted schema: (database).(schema).(object name) and thus having dots in your table names is just asking for trouble at some point....), then you should be able to create your constraint like this:
ALTER TABLE [Admin.Document]
ADD CONSTRAINT FK_AdminDocument_CodeTableCodeID
FOREIGN KEY(DocumentTypeID) REFERENCES [Code.CodeTable](CodeID)
Since you have dots in your table names, you need to enclose those names in square brackets [].
Basically, you need to modify the child table and tell SQL Server which column in that child table refers to what parent table and column in the parent table.