Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo box button returns blank form

Status
Not open for further replies.

waylander786

IS-IT--Management
Apr 10, 2006
50
0
0
GB
I have created a form in Access to displat client records,
it is doing this fine. I then created another form with a combo box using client ID. I have created a button which will open up the client records form on click matching the drop down client ID on combo box. It is opening the client records form, but the form is blank,

can anyone please advise
 
Could you give us some details about the form you're opening, it's recordsource for example?

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
The Form i wish to display has been created using the wizard, i am an absolute beginner so i am not sure what you mean by record source, it displays all the records in a table, you can add records to it but there are no submit buttons
 
No problem, it might be easiest if you post the code you're using when you click the button to display the clients record.

Cheers

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
Hi the Record Source is showing the table name, but below is the code for the button event -


Private Sub Command4_Click()
On Error GoTo Err_Command4_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Marac"

stLinkCriteria = "[Guardian Reference]=" & "'" & Me![Combo0] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command4_Click:
Exit Sub

Err_Command4_Click:
MsgBox Err.Description
Resume Exit_Command4_Click

End Sub
 
And the value showing in the combobox is definitely a [Guardian Reference] and exists in the table?

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
yes, that is a field in the table which contains many records, and it is also displayed in the form
 
i have put the following SQL in the row source of the combo box and it is now returning records in the form
SELECT Marac.Guardian_Reference FROM Marac;

however, the combobox is not listing any values in the dropdown
 
Are you using the correct column name?

In your first post(s) you called the column [Guardian Reference] and in your last post you've named it [Guardian[red]_[/red]Reference], could that be the problem?

Hope this helps

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
i renamed the column in the table as the first name had a space, the new name has underscore and references to it are using the new name
 
So that SQL doesn't populate the combobox with any data? How is being used to return records on the form then? [ponder]

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
i know its sounds crazy but when i run the form the combox box drop down arrow appears and i can scroll down but its not showing the guardian reference in the list, however i can select any blank value in the list and it will display a different client record each time
 
I'd have a look at the format tab in the properties and see what the settings are for columns (count, width etc.) and post back what you've got for them (also boundcolumn property).

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
yeah column width read 0;2.54cm... i have deleted the 0; and irs working fine... thanks you very much for your support have a nice day!
 
You're welcome, glad I could help [smile]

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top