Use BrowseDialog to fill some fields


Author
Message
Juan Carlos Pazos
Juan Carlos Pazos
StrataFrame User (310 reputation)StrataFrame User (310 reputation)StrataFrame User (310 reputation)StrataFrame User (310 reputation)StrataFrame User (310 reputation)StrataFrame User (310 reputation)StrataFrame User (310 reputation)StrataFrame User (310 reputation)StrataFrame User (310 reputation)
Group: Forum Members
Posts: 144, Visits: 227
Hi

I'm using BrowseDialog in may forms in my application, of course the BrowseDialog is always used to find an specific record.

I have the idea of use BrowseDialog just to fill some fields in my form, not to recover a record.

I will try to describe the idea:

I have a form to contacts, is a normal maintenance form, it has a BrowseDialog for find contacts. Part of the information of contacts is State - City - Locality - Postal Code. Some we have a field for each value, I use combos to select the state, based on selected other combo is filled with the city in locality I can use another combo too. But as the Postal Codes table has the information of locality, city and state, I think users can select a postal code and the fields of locality, city and state can be filled.

The idea is use a BrowseDialog where users can search by postal code, state, or any other of the fields there, once the found the desired record, when go back to the form this will fill the text boxes according to their selection. Is this possible with BrowseDialog?

Waiting for your valuable comments.

Regards.

Smile Everything is possible, just keep trying...

Reply
Dustin Taylor
Dustin Taylor
StrataFrame Team Member (938 reputation)
Group: StrataFrame Users
Posts: 364, Visits: 771
Sure Smile

Here is a slightly simplified version of what we do:

Public Shared Function GetZipCode(ByVal ZipCode As String) As ZipCodeItem
   '-- Establish Locals
   Dim loReturn As ZipCodeItem
   '-- Create a new item
   loReturn = New ZipCodeItem()
   '-- Load the BO
   ZipCodesBO.FillByZipCode(ZipCode)
   '-- See if a record was found
   If ZipCodesBO.Count > 0 Then
      loReturn.AreaCode = ZipCodesBO.AreaCode.Trim()
      loReturn.City = ZipCodesBO.City.Trim()
      loReturn.State = ZipCodesBO.State.Trim()
      loReturn.ZipCode = ZipCode.Trim()
   End If
   '-- Return the results
   Return loReturn
End Function

 

We call the above method on the shared class whenever we want to get the details for a given zip code. A "ZipCodeItem" is returned, containing the details found there (AreaCode, City, State, ZipCode). As you can see, within the method we pull the zip code information into a temporary instance of our own ZipCode BO, but you could do the same with a straight SQL query if you would prefer and cut out that temporary BO all together.


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search