To find the value of \( p \) in the volume of a rectangular prism, we can use the formula for the volume of a rectangular prism:
\[ \text{Volume} = \text{length} \times \text{width} \times \text{height} \]
In this case, we have:
\[ V = 14 , \text{mm} \times 18 , \text{mm} \times p \]
Given that the volume is 5,040 cubic millimeters, we can set up the equation:
\[ 14 \times 18 \times p = 5040 \]
First, calculate \( 14 \times 18 \):
\[ 14 \times 18 = 252 \]
Now, substitute this back into the equation:
\[ 252 \times p = 5040 \]
To isolate \( p \), divide both sides by 252:
\[ p = \frac{5040}{252} \]
Now, calculate \( \frac{5040}{252} \):
\[ p = 20 \]
Thus, the value of \( p \) is:
\[ \boxed{20 , \text{millimeters}} \]