Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Database and Reporting > move to next record


Reply
 
Thread Tools Display Modes
  #1  
Old 09-30-2004, 04:55 AM
Jerry Shane Jerry Shane is offline
Junior Contributor
 
Join Date: Nov 2001
Location: Indianapolis, IN
Posts: 367
Default move to next record


I'm trying to get this to work I've got a combo box with text in it and a command button to move to the next record but it's not working right here's what it is doing if I select Apt 150 from the combo box type in a name in a text box for that Apartment then click on my add name buttonto add it to that apartment then click on the command button to move to the next record so I can enter another name for the same apartment it moves to the next item I have in the combo box which is another apartment. I don't want that is there a way to have it stay on the selected apartment so I can add other names to that apartment. also when I click on the add button it clears the combo box of the selected apartment so I have to select it again which is not what I want either.
Reply With Quote
  #2  
Old 09-30-2004, 05:08 AM
MKoslof's Avatar
MKoslof MKoslof is offline
Cum Grano Salis

Retired Moderator
* Guru *
 
Join Date: Jul 2002
Location: Baltimore, Maryland
Posts: 14,636
Default

Can you post your current code ..that would help us spot the potential error .
__________________
"Artificial Intelligence is no match for natural stupidity." ~unknown
Reply With Quote
  #3  
Old 09-30-2004, 08:35 AM
Jerry Shane Jerry Shane is offline
Junior Contributor
 
Join Date: Nov 2001
Location: Indianapolis, IN
Posts: 367
Default

Quote:
Originally Posted by MKoslof
Can you post your current code ..that would help us spot the potential error .
Sorry, but all it is is the default code that access puts when you add a command button to add a new record if you want I can post that I just need to know what the code would be to when the addNew command button is selected it will add the record and then move to the next record. If I'm on record #2 click add it will add that record then move to the next record.
Reply With Quote
  #4  
Old 09-30-2004, 10:28 AM
MKoslof's Avatar
MKoslof MKoslof is offline
Cum Grano Salis

Retired Moderator
* Guru *
 
Join Date: Jul 2002
Location: Baltimore, Maryland
Posts: 14,636
Default

That is not alot of information to go on, but if you want to move next, you can check for EOF and then do a .moveNext call.

Code:
If Not rs.EOF Then rs.moveNext End If
__________________
"Artificial Intelligence is no match for natural stupidity." ~unknown
Reply With Quote
  #5  
Old 09-30-2004, 11:54 AM
Jerry Shane Jerry Shane is offline
Junior Contributor
 
Join Date: Nov 2001
Location: Indianapolis, IN
Posts: 367
Default

Quote:
Originally Posted by MKoslof
That is not alot of information to go on, but if you want to move next, you can check for EOF and then do a .moveNext call.

Code:
If Not rs.EOF Then rs.moveNext End If
Okay, Here is the code I have for the Add button do you need the code for my comboboxes as well?
Code:
Private Sub Add_Click() On Error GoTo Err_Add_Click DoCmd.GoToRecord , , acNewRec Exit_Add_Click: Exit Sub Err_Add_Click: MsgBox Err.Description Resume Exit_Add_Click End Sub
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->