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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo Box Error Message

Status
Not open for further replies.

Garridon

Programmer
Mar 2, 2000
718
US
This one has got me stumped.<br>
<br>
I have a form with combo boxes. If I don't select an entry in the combo boxes and click the add or close button, I get a error message telling me that &quot;You can't go to the specified record. You may be at the end of a record set.&quot;<br>
<br>
In a second database, this goes one step further. I have to import records in. However, I cannot view them on the form at all when I do this--if I important twenty records in, I'll still only see the original 10. I have to manually go into the table and add in the information for the combo box field for those records to show up.<br>
<br>
In the table, I have the required field checked as No. I have also looked at all the examples of databases that come with Access. None of them do this, but I can't figure out what they're doing and I'm not. What am I missing?<br>
<br>
Thanks!
 
Garridon,<br>
Are the combo boxes bound to any fields? And, what is the rowsource of these boxes? Also, to what 'add' button do you refer?<br>
--Jim
 
Yes, both combo boxes are bound to fields. I created them using the wizard. Here are the row sources:<br>
<br>
SELECT DISTINCTROW [tblTaskStatus].[lngTaskStatusID], [tblTaskStatus].[strTaskStatus] FROM [tblTaskStatus];<br>
<br>
SELECT DISTINCTROW [tblProjectOfficers].[lngProjectOfficerID], [tblProjectOfficers].[strFirstName]&&quot; &quot;& [tblProjectOfficers].[strLastName] FROM [tblProjectOfficers];<br>
<br>
The Add button I referred to is a wizard generated button to Add a new record. The Close button just closes the form.
 
On your second question, after you import the records, do you refresh your form?<br>
Me!Refresh
 
Yes, I do. This is what I have:<br>
<br>
Private Sub Form_Activate()<br>
On Error GoTo Err_Form_Activate<br>
Me.Refresh<br>
<br>
Exit_Form_Activate:<br>
Exit Sub<br>
<br>
Err_Form_Activate:<br>
MsgBox Err.Description<br>
Resume Exit_Form_Activate<br>
End Sub<br>
<br>
<p>Linda Adams<br><a href=mailto:Garridon@aol.com>Garridon@aol.com</a><br><a href= Adams Online</a><br>I'm a professional writer, published internationally.
 
Activate happens when the form first gets focus. Try putting the code into something that happens after your import routine, or even at the end of your import routine itself.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top