boblarson 15 Junior Poster in Training

Use the "On Change" event in your first combo box, update the "filter" property on your second combo box and issue a refresh.

Actually it should be in the combo's AFTER UPDATE event, not the On Change. On Change will also fire for every keystroke if someone starts typing in it which can cause problems and slow things down, depending on things.

BitBlt commented: Good catch. +7
boblarson 15 Junior Poster in Training

You don't need to use the search to find the record in the other table. You would use a SQL Statement and recordset to bring back the appropriate record if there was one:

'SEARCH FOR THE RECORD IN REMARK TABLE
   Dim strSQL As String
   Dim strWHERE As String
   Dim rs As DAO.Recordset
   
   ' I assume that BuildCriteria does NOT return the word WHERE at the beginning
   strWHERE = BuildCriteria("[IDOp]", dbInteger, OpNameClick)

   strSQL = "SELECT * FROM Remark WHERE " & strWHERE

   Set rs = CurrentDb.OpenRecordset(strSQL)
   If rs.RecordCount = 0 Then
     Msgbox "Record does not exist"
   Else
     ' do whatever here with the record you have found from the other table
     ' not sure what it is you really want or what to do with it.
   End If

   rs.Close
   Set rs = Nothing
boblarson 15 Junior Poster in Training

hi all,
i have created a crosstab query and one of the row heading contains a hyperlink field.
my problem is that the field is not working,
and on top of that it gives corrupted values too.

pls help
thanks

I don't believe you can use that directly in a crosstab. Create your crosstab query without that field and then create a select query which joins the crosstab with the hyperlink field in it.

boblarson 15 Junior Poster in Training

Copy this function into a standard module (not form, report or class) and name the module something other than the name of the function:

Function AdjustProcNum(strTableName As String, strFieldName As String, lngNewNum As Long)
   Dim strSQL As String
   Dim rst As DAO.Recordset

strSQL = "Select [" & strFieldName & "] From [" & strTableName & "] " & _
         "ORDER BY [" & strFieldName & "]"

Set rst = CurrentDb.OpenRecordset(strSQL)

Do Until rst.EOF
   If rst(strFieldName).Value >= lngNewNum Then
      rst.Edit
      rst(strFieldName).Value = rst(strFieldName).Value + 1
      rst.Update
   End If
   rst.MoveNext
Loop

MsgBox "You can now enter the new process number " & lngNewNum, vbInformation

rst.Close
Set rst = Nothing   
End Function
boblarson 15 Junior Poster in Training

I'm assuming Outcome is numeric but it wouldn't have to be but you would change the value for NZ to vbNullString if it is text.

MyNum1 = ]")[B]Nz([/B]DLookup("[Outcome]", "Remark", _
      "[IDRemark] = Form![SelectTxt]")[B],0)[/B]
OutTxt.Value = MyNum1
boblarson 15 Junior Poster in Training
mailtosridar commented: thanks boblarson +1
boblarson 15 Junior Poster in Training

Microsoft Access lo... how is it?? MS Access provided interface and database.. i jz dunno how to convert it to open the designed interface with no need open MS access

There are some third party tools out that will help you convert an Access app to VB or VB.NET but you really can't just "convert" an Access application to an executable.

If you are using Access 2007, you CAN use the Runtime version of Access and the free developer's kit (search for Access 2007 SDK on the Microsoft Site) and you can distribute the files, including the Runtime version via an installation package.

However, you will still have the Access window and you will need to provide "bullet-proof" error handling and custom toolbars/Ribbon for your users.

peter_budo commented: Good tip +7