HOW CAN I USE A FORM FOR A SEARCH OR FIND TO POPULATE ANOTHER FORM

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'M ALMOST TO THE END OF MY PROGRAM PROJECT THEN I MET THIS PROBLEM.
THE PROGRAM REQUIRES ME TO CREATE A SEARCH/FIND FORM. IT WILL BE UNBOUND SO
THAT AT OPENNING NO RECORD WILL BE ON THE OBJECTS FORM. THE OBJECTS WILL BE
57 IN NUMBER, WHICH IS THE NUMBER OF FIELDS IN THE TABLE.

THE PURPOSE OF THIS FORM WILL BE THAT WHEN THE USERS ENTERS THE REQUIRED
INFOR RECORD IN ANY OF THE OBJECTS (JUST ONLY IN ONE) IT WILL FIND ALL THE
OTHER RECORDS ASSOCIATED WITH IT. AND SENDS THE INFOR INTO ANOTHER FORM
CALLED THE EDIT VIEW FORM.

PLEASE I NEED A BIG HELP IN THIS ASPECT. I HAVE DONE ALL I COULD AND IT IS
NOT WORKING OUT. CAN SOMEONE PLEASE HELP ME OUT.

THANKS.
 
Dear Ofer, it is good getting your contribution. But unfortuately, that will
not solve my problem because I did something similar to that and it was not
accepted.

What I'm required to do is this. To have a form that all the textboxes and
the comboxes will be unbound, as a matter of fact they are 57 in number.
Assuming the user cannot remember the FileNumber for instance and enter for
instance a Street Address or chooses any other valid record within the table
and enters it into the appropriate textbox or selects a Municipal from the
combobox for example it will immediately give the user all the information
in the table that pertains to the record he entered. And this information
will be populated into another form called 'Edit View Form" which will open
automatically, with all the search results.

I'm still waiting for more contributions. Please let someone help me out.

Thanks very much.
 
Why don't you just use a normal form that is bound to the table? Then
Access /automatically/ lets you search the table by any value, or
combination of values. You do not need to write any code, at all.

HTH,
TC [MVP Access]
 
TC I will like to know two things from you, that will actually make my
problem easier.

(1) How will I make this form to open without any record, that is to open
blank of records in the textbox an the combobox.
(2) How will this form on enter populate another form with it's result, so
that the user can make changes, or update based on whatever he wants to do?

I do appreciate all these contributions I know someone will certianly help
me out.
 
TC,
I will like to know two things from you, that will actually make my burden
less.
(1) How will I make this form to open without any record, that is to open
blank of records in the textbox and the combobox. (2) How will this form on
enter populate another form with it's result, so that the user can make
changes, or update based on whatever he wants to do?
I do appreciate all these contributions I know someone will certianly help
me out.
Though, right now I have this code below which can only search with
Filenumber. I have tried to use it with the Municipality and other parameters
in the table field and it is not working what am I doing wrong and how can I
correct it.

Private Sub SEARCH_RECORD_Click()
On Error GoTo Err_SEARCH_RECORD_Click

This section is working great, finding any file number entered into the text
box and populating it to the Edit Form.
Dim stDocName As String
Dim stLinkCriteria As String
'Check to make sure a correct File Number was entered
Me.FILENO.SetFocus
If Me.FILENO.Text = "" Then
MsgBox "PLEASE ENTER A VALID FILENO", vbExclamation, "ACRP"
Exit Sub
End If
'Select records from Edit Record Form that match the selection criteria of
'a chosen File Number
Me.FILENO.SetFocus
If Me.FILENO.Text = "" Then
stLinkCriteria = "[FILENO] Like '*" & Me.STREET & "*' "
ElseIf Me.FILENO.Text <> "" Then
stLinkCriteria = "[FILENO] Like '*" & Me.STREET & "*' and [FILENO] =
'" & Me.FILENO & "' "
End If

This section of the code is not working! So what is it that I'm doing
wrongly. Because I have up to 50 parameters and objects that I have to work
with. Right now it's only one working.
'Check to make sure a correct Municipality was entered
'Me.MUNICIPALITY.SetFocus
'If Me.MUNICIPALITY.Text = "" Then
' MsgBox "PLEASE ENTER A VALID Municiplaity", vbExclamation, "ACRP"
' Exit Sub
'End If
'Select records from Edit Record Form that match the selection criteria of
'a Municipal
' Me.MUNICIPALITY.SetFocus
' If Me.MUNICIPALITY.Text = "" Then
' stLinkCriteria = "[MUNICIPALITY] Like '*" & Me.STREET & "*' "
'ElseIf Me.MUNICIPALITY.Text <> "" Then
' stLinkCriteria = "[MUNICIPALITY] Like '*" & Me.STREET & "*' and
[MUNICIPLAITY] = '" & Me.MUNICIPALITY & "' "
'End If




stDocName = "EDITRECORDFORM"
DoCmd.Close
DoCmd.OpenForm stDocName, , , stLinkCriteria



Exit_SEARCH_RECORD_Click:
Exit Sub

Err_SEARCH_RECORD_Click:
MsgBox Err.Description
Resume Exit_SEARCH_RECORD_Click

End Sub

Zetony said:
TC said:
Why don't you just use a normal form that is bound to the table? Then
Access /automatically/ lets you search the table by any value, or
combination of values. You do not need to write any code, at all.

HTH,
TC [MVP Access]
 
Back
Top