Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Difficult problems in ACCESS, please help! Tell me what to do.
Difficult problems in ACCESS, please help! Tell me what to do.
1. Suppose there are two fields in the "tGroup" table, namely "Department" and "Department Name".

"Department" and "Department" are linked in the report data source, and "Department Name" should be displayed.

1) If the field type of "Department" is plastic or long plastic, the control source formula of tDept is:

Dlookup ("department name", "T group", "department ="&; [department])

2) If the field type is text, then:

Dlookup ("department name", "T group", "department ='"&; [Department]&"'")

This is similar to sql syntax, using single quotation marks before and after the text.

2. In addition, I suggest that you can try to use the "Department" control directly in the report, change the text box into a combo box, hide the key columns and display the text directly:

If the number of columns is 2, the binding column is 1 and the column width is 0 "; 1",

The line source is "Select [Department] and [Department Name] from tGroup (it can also be edited according to the wizard).