Hi.
I stay away from Dreamweaver's overrated tools like the plague... so I won't be able to help you with those.
But I can show you how to do this in PHP code:
<?php
// Establish a DB connection
$dbLink = new mysqli('localhost', 'usr', 'pwd', 'db_name');
if(mysqli_connect_errno()) {
printf("Database connection failed: %s", mysqli_connect_error());
exit;
}
// Initialize an array containing posible
// inital values for the form fields
$initalValues = array(
'name' => '',
'email' => '',
'whatever' => ''
);
// Check if a previous user has been selected
// from the dropdown.
($previousID = @$_POST['PreviousCustomer']) or $previousID = null;
if($previousID) {
// Get the data for this customer.
$customerID = $dbLink->real_escape_string($_POST['PreviousCustomer']);
$sql = "SELECT name, email, whatever FROM customer WHERE id = {$customerID}";
$result = $dbLink->query($sql);
if($result->num_rows > 0) {
$row = $result->fetch_assoc();
$initalValues = $row;
}
else {
user_error("The given customer id did not match any customer.", E_USER_NOTICE);
}
@$result->close();
}
// Open the form
echo '<form id="formID" action="otherFile.php" method="post">';
// Print the <select> box.
// Note that I use JavaScript to alter the action
// of the <form> element when an option is selected,
// so that it reloads this page rather than go on to
// the submission page, and then submit it.
echo ' <select name="PreviousCustomer"
onchange="if(this.value != \'\') {
document.getElementById(\'formID\').action=\'?\';
document.getElementById(\'formID\').submit();
}"
>';
echo ' <option value=\'\'>- Select -</option>';
// Print a list of previous customers as
// options for the <select>
$sql = "SELECT id, name FROM customer";
$result = $dbLink->query($sql);
while($row = $result->fetch_assoc()) {
$selected = ($row['id'] == $previousID ? 'selected="selected"' : '');
echo "<option value='{$row['id']}' {$selected}>{$row['name']}</option>";
}
// Close the <select> and print the rest of the form
echo '</select>';
echo <<< HTML
Name: <input type="text" name="name" value="{$initalValues['name']}" />
Email: <input type="text" name="email" value="{$initalValues['email']}" />
Whatever: <input type="text" name="whatever" value="{$initalValues['whatever']}" />
<input type="submit" />
</form>
HTML;
// Close the database link
$dbLink->close();
?>