Question: ```
 OleDbConn.ole = "SELECT InvoiceDate,InvoiceNo,Customer,SalesPerson,TotalAmount"
 +" FROM Invoice WHERE InvoiceDate BETWEEN "
 + startDate.ToString("yyyy-MM-dd") 
 + " AND " + endDate.ToString("yyyy-MM-dd")
 + " AND (InvoiceNo LIKE '%" + txtSearch.Text 
 + "%' OR SalesPerson LIKE '%"+ txtSearch.Text 
 + "%' OR Customer LIKE '%" + txtSearch.Text + "%') GROUP BY InvoiceNo,InvoiceDate,Customer,SalesPerson,TotalAmount " 
 +"ORDER BY InvoiceDate, InvoiceNo DESC"; //here is my search query

dgw.Rows.Add(
     Convert.ToDateTime(OleDbConn.dr[0]).ToString("MM/dd/yyyy"), 
     OleDbConn.dr[1].ToString(),OleDbConn.dr[2].ToString(),
     OleDbConn.dr[3].ToString(), 
     Strings.FormatNumber(OleDbConn.dr[4]).ToString(), 
     Strings.FormatNumber(OleDbConn.dr[4]).ToString()); //adding data to gridview

```

when a user selects the dates between its supposed to show data in gridview but its not, code works well in sql but its failing in ms-access

Answer: 
First save your input value to some variables using onChangeText 

```
<TextInput
value= {this.state.userName}
onChangeText = {(text)=>{
this.setState({userName:text});
}
 />

```

Then you can pass the value ,

```
<Button 
 onPress={() => navigate('HomePage',{"userName":this.state.userName})} // you can pass objects
  title="Login"
   />

```
Do the following changes :

In Login component : 

**Username Field**

```
<TextInput 
          style={{width:190,color:'white'}} 
          placeholder="User Name" 
          placeholderTextColor="#f9f9f9" 
          underlineColorAndroid='#f9f9f9'
          onChangeText=
            {(username)=>this.setState({username})}
/>

```

**Button :** 

```
<TouchableOpacity style={{top:10}}>
        <Button 
          color="#314561" 
          onPress={() => navigate('HomePage'), { username: this.state.username }} 
          title="Login"/>
        </TouchableOpacity>

```

In Home component:

e.g. `render method` 

```
  render(){
      const {state} = this.props.navigation;
      console.og(state.params.username)
    }

```

**Update :**
In login constructor,initialise `state`

```
constructor(){
   super();
   this.state = {};
}

```