|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
I am trying to figure out how to loop through a recordset and look for a value within each record.
What I have basically. I have an Access.adp, I have a query that pulls up, Name, Age, Sex (M/F) I have this data populating a continous form. I have inserted a button on the line of data with the visible set to NO. What I want is to have the button show when the sex="M" and not show when sex="F". button name = cmdSex (don't worry about the name LOL) Form = frmPerson I have looked through tons of examples about rst and such, but I can't seem to get anything to pickup the value past the first record within the dataset. Data will not be changed within the form. The button (when visible) will be used to bring up a different form with the user clicks on it. I know this all sounds really simple, but I haven't figured it out. Hope someone can shine a LOT of light on me..!! ![]() |
|
#2
|
|||
|
|||
|
Delete the button and place the following code behind your frmPerson:
If they double click the sex for male record next form displays If they double click the sex for a female nothing happens. Private Sub Sex_DblClick(Cancel As Integer) On Error GoTo Err_Sex_DblClick Dim stDocName As String Dim stLinkCriteria As String stDocName = "SubFrmPeople" stLinkCriteria = "[RecID]=" & Me![RecID] If Me!Sex = "M" Then DoCmd.OpenForm stDocName, , , stLinkCriteria Else Exit Sub End If Exit_Sex_DblClick: Exit Sub Err_Sex_DblClick: MsgBox Err.Description Resume Exit_Sex_DblClick End Sub Quote:
|
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft Access Development > Looping recordset |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|